@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.
- package/applications/Components/imageryUtils.js +1 -1
- package/arcade/featureset/sources/FeatureLayerOGC.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{f97a7cb367634353177d.js → 001a7a4cf6fe74432ed6.js} +1 -1
- package/assets/esri/core/workers/chunks/00ff4ca88c9d291d82c3.js +1 -0
- package/assets/esri/core/workers/chunks/04a0685ee53ef74883aa.js +1 -0
- package/assets/esri/core/workers/chunks/{c320a29df40e85fb4a8e.js → 15a0750c10b510564a42.js} +1 -1
- package/assets/esri/core/workers/chunks/{9d95f38da21f97214f83.js → 1e0e7cef7ef947894bbe.js} +10 -10
- package/assets/esri/core/workers/chunks/20ad34f9d45c64392022.js +1 -0
- package/assets/esri/core/workers/chunks/23396a6318edf9264c1f.js +1 -0
- package/assets/esri/core/workers/chunks/{816227de5bd42b437df4.js → 233f9eb617f3d72995b5.js} +1 -1
- package/assets/esri/core/workers/chunks/{fb9643b74cf35221ff98.js → 249504f7d356be80d214.js} +1 -1
- package/assets/esri/core/workers/chunks/{ad891ac388fa6c1c9b94.js → 2b34a010f76e5f289868.js} +1 -1
- package/assets/esri/core/workers/chunks/2ef4c0092c59a98a5532.js +1 -0
- package/assets/esri/core/workers/chunks/35272810c2ed04eb403d.js +1 -0
- package/assets/esri/core/workers/chunks/{4f4d51181ae7db9fbe6d.js → 4404b6f931f681cca342.js} +1 -1
- package/assets/esri/core/workers/chunks/555a0ea44ba77819d493.js +1 -0
- package/assets/esri/core/workers/chunks/6e8925412fb90f88d688.js +1 -0
- package/assets/esri/core/workers/chunks/{d1f4152b2b8d47cbf586.js → 72fbee59d5d909615408.js} +1 -1
- package/assets/esri/core/workers/chunks/75c66e38bdc1c786c599.js +1 -0
- package/assets/esri/core/workers/chunks/7d3c2a063598bdd015e2.js +1 -0
- package/assets/esri/core/workers/chunks/83da9ee6544ee9d3c124.js +1 -0
- package/assets/esri/core/workers/chunks/897ce6fc9cefb1e14a64.js +1 -0
- package/assets/esri/core/workers/chunks/{da517b4b07d4d27ce94c.js → 8e26831f71634288f834.js} +1 -1
- package/assets/esri/core/workers/chunks/{c367c7e553be3682f2db.js → 93c5f097bb7b380bb175.js} +1 -1
- package/assets/esri/core/workers/chunks/992e9bbdf9d3787ddb0e.js +1 -0
- package/assets/esri/core/workers/chunks/9c7682b300b877f60095.js +1 -0
- package/assets/esri/core/workers/chunks/a2442549c5daf3653eb4.js +1 -0
- package/assets/esri/core/workers/chunks/a7cd795042ebb8585906.js +1 -0
- package/assets/esri/core/workers/chunks/{f3b3b193959db809c8c6.js → ab520fd1ae917daf07d8.js} +1 -1
- package/assets/esri/core/workers/chunks/{2c9865e34f32fb5683e5.js → af8d6e6949930d0e6c7b.js} +1 -1
- package/assets/esri/core/workers/chunks/c9942ca57f542582ab4d.js +1 -0
- package/assets/esri/core/workers/chunks/ca1c65eb7f5900c60170.js +1 -0
- package/assets/esri/core/workers/chunks/cddce67919e13e2f365e.js +1 -0
- package/assets/esri/core/workers/chunks/da2ba40bc017bff0fe49.js +1 -0
- package/assets/esri/core/workers/chunks/e5a6a646f27715152714.js +1 -0
- package/assets/esri/core/workers/chunks/e6784251bbb8b71ead93.js +1 -0
- package/assets/esri/core/workers/chunks/e8a9971c8354569cb81d.js +1 -0
- package/assets/esri/core/workers/chunks/{96f798ee286b59396131.js → ea3cba01c60d9bc72719.js} +1 -1
- package/assets/esri/core/workers/chunks/ed550bf27f2bbf8d30fa.js +1 -0
- package/assets/esri/core/workers/chunks/ee186ddbb1eb5144a790.js +1 -0
- package/assets/esri/core/workers/chunks/{1357cc637524cd254974.js → ffcdc7ae03b0570e0db8.js} +1 -1
- package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
- package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
- package/assets/esri/themes/base/widgets/_Attribution.scss +1 -1
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/config.js +1 -1
- package/core/PooledArray.js +1 -1
- package/geometry/FlatGeometry.js +1 -1
- package/geometry/support/MeshMaterialMetallicRoughness.js +1 -1
- package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
- package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
- package/interfaces.d.ts +109 -37
- package/kernel.js +1 -1
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/WCSLayer.js +1 -1
- package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
- package/layers/graphics/sources/support/clientSideDefaults.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/mixins/ImageryTileMixin.js +1 -1
- package/layers/mixins/RasterJobHandlerMixin.js +1 -1
- package/layers/ogc/wcsUtils.js +1 -1
- package/layers/raster/datasets/BaseRaster.js +5 -0
- package/layers/raster/datasets/CovJSONRaster.js +5 -0
- package/layers/raster/datasets/FunctionRaster.js +5 -0
- package/layers/raster/datasets/ImageAuxRaster.js +5 -0
- package/layers/raster/datasets/ImageServerRaster.js +5 -0
- package/layers/raster/datasets/InMemoryRaster.js +5 -0
- package/layers/raster/datasets/MRFRaster.js +5 -0
- package/layers/raster/datasets/RawBlockCache.js +5 -0
- package/layers/raster/datasets/TIFFRaster.js +5 -0
- package/layers/raster/datasets/WCSRaster.js +5 -0
- package/layers/raster/datasets/covJSONParser.js +5 -0
- package/layers/raster/datasets/multidimensionalUtils.js +5 -0
- package/layers/raster/datasets/pamParser.js +5 -0
- package/layers/raster/datasets/pixelReader.js +5 -0
- package/layers/raster/datasets/wcsCoverageParser.js +5 -0
- package/layers/raster/formats/Lerc.js +5 -0
- package/layers/raster/formats/Qb3.js +5 -0
- package/layers/raster/formats/RasterCodec.js +5 -0
- package/layers/raster/formats/TiffDecoder.js +5 -0
- package/layers/raster/functions/ArithmeticFunction.js +5 -0
- package/layers/{support/rasterFunctions → raster/functions}/ArithmeticFunctionArguments.js +1 -1
- package/layers/{support/rasterFunctions → raster/functions}/AspectFunction.js +1 -1
- package/layers/{support/rasterFunctions → raster/functions}/AspectFunctionArguments.js +1 -1
- package/layers/raster/functions/BandArithmeticFunction.js +5 -0
- package/layers/{support/rasterFunctions → raster/functions}/BandArithmeticFunctionArguments.js +1 -1
- package/layers/{support/rasterFunctions → raster/functions}/BaseFunctionArguments.js +1 -1
- package/layers/raster/functions/BaseRasterFunction.js +5 -0
- package/layers/{support/rasterFunctions → raster/functions}/ClipFunction.js +1 -1
- package/layers/{support/rasterFunctions → raster/functions}/ClipFunctionArguments.js +1 -1
- package/layers/raster/functions/ColormapFunction.js +5 -0
- package/layers/{support/rasterFunctions → raster/functions}/ColormapFunctionArguments.js +1 -1
- package/layers/raster/functions/ColormapToRGBFunction.js +5 -0
- package/layers/{support/rasterFunctions → raster/functions}/ColormapToRGBFunctionArguments.js +1 -1
- package/layers/raster/functions/CompositeBandFunction.js +5 -0
- package/layers/raster/functions/CompositeBandFunctionArguments.js +5 -0
- package/layers/raster/functions/ComputeChangeFunction.js +5 -0
- package/layers/{support/rasterFunctions → raster/functions}/ComputeChangeFunctionArguments.js +1 -1
- package/layers/{support/rasterFunctions → raster/functions}/ContrastBrightnessFunction.js +1 -1
- package/layers/{support/rasterFunctions → raster/functions}/ContrastBrightnessFunctionArguments.js +1 -1
- package/layers/raster/functions/ConvolutionFunction.js +5 -0
- package/layers/raster/functions/ConvolutionFunctionArguments.js +5 -0
- package/layers/{support/rasterFunctions → raster/functions}/CurvatureFunction.js +1 -1
- package/layers/{support/rasterFunctions → raster/functions}/CurvatureFunctionArguments.js +1 -1
- package/layers/{support/rasterFunctions → raster/functions}/ExtractBandFunction.js +1 -1
- package/layers/{support/rasterFunctions → raster/functions}/ExtractBandFunctionArguments.js +1 -1
- package/layers/{support/rasterFunctions → raster/functions}/GrayscaleFunction.js +1 -1
- package/layers/{support/rasterFunctions → raster/functions}/GrayscaleFunctionArguments.js +1 -1
- package/layers/raster/functions/HillshadeFunction.js +5 -0
- package/layers/{support/rasterFunctions → raster/functions}/HillshadeFunctionArguments.js +1 -1
- package/layers/raster/functions/LocalFunction.js +5 -0
- package/layers/{support/rasterFunctions → raster/functions}/LocalFunctionArguments.js +1 -1
- package/layers/{support/rasterFunctions → raster/functions}/MaskFunction.js +1 -1
- package/layers/{support/rasterFunctions → raster/functions}/MaskFunctionArguments.js +1 -1
- package/layers/{support/rasterFunctions → raster/functions}/NDVIFunction.js +1 -1
- package/layers/{support/rasterFunctions → raster/functions}/NDVIFunctionArguments.js +1 -1
- package/layers/raster/functions/RemapFunction.js +5 -0
- package/layers/{support/rasterFunctions → raster/functions}/RemapFunctionArguments.js +1 -1
- package/layers/raster/functions/ShadedReliefFunction.js +5 -0
- package/layers/{support/rasterFunctions → raster/functions}/ShadedReliefFunctionArguments.js +1 -1
- package/layers/raster/functions/SlopeFunction.js +5 -0
- package/layers/{support/rasterFunctions → raster/functions}/SlopeFunctionArguments.js +1 -1
- package/layers/raster/functions/StatisticsFunction.js +5 -0
- package/layers/{support/rasterFunctions → raster/functions}/StatisticsFunctionArguments.js +1 -1
- package/layers/{support/rasterFunctions → raster/functions}/StatisticsHistogramFunction.js +1 -1
- package/layers/{support/rasterFunctions → raster/functions}/StatisticsHistogramFunctionArguments.js +1 -1
- package/layers/raster/functions/StretchFunction.js +5 -0
- package/layers/{support/rasterFunctions → raster/functions}/StretchFunctionArguments.js +1 -1
- package/layers/{support/rasterFunctions → raster/functions}/TableFunction.js +1 -1
- package/layers/{support/rasterFunctions → raster/functions}/TableFunctionArguments.js +1 -1
- package/layers/raster/functions/bandIndexUtils.js +5 -0
- package/layers/raster/functions/changeDetectionUtils.js +5 -0
- package/layers/raster/functions/clipUtils.js +5 -0
- package/layers/raster/functions/conversionUtils.js +5 -0
- package/layers/raster/functions/convolutionUtils.js +5 -0
- package/layers/raster/functions/creators/createDataManagementFunctions.js +5 -0
- package/layers/raster/functions/creators/utils.js +5 -0
- package/layers/raster/functions/focalStatUtils.js +5 -0
- package/layers/raster/functions/localUtils.js +5 -0
- package/layers/raster/functions/pixelTransformUtils.js +5 -0
- package/layers/raster/functions/pixelUtils.js +5 -0
- package/layers/raster/functions/stretchUtils.js +5 -0
- package/layers/raster/functions/surfaceUtils.js +5 -0
- package/layers/raster/functions/vectorFieldUtils.js +5 -0
- package/layers/raster/transforms/BaseRasterTransform.js +5 -0
- package/layers/{support/rasterTransforms → raster/transforms}/GCSShiftTransform.js +1 -1
- package/layers/{support/rasterTransforms → raster/transforms}/IdentityTransform.js +1 -1
- package/layers/{support/rasterTransforms → raster/transforms}/PolynomialTransform.js +1 -1
- package/layers/save/imageryUtils.js +1 -1
- package/layers/support/PixelBlock.js +1 -1
- package/layers/support/RasterWorker.js +1 -1
- package/layers/support/imageryRendererUtils.js +1 -1
- package/layers/support/rasterFunctionUtils.js +1 -1
- package/package.json +1 -1
- package/renderers/VectorFieldRenderer.js +1 -1
- package/renderers/support/RasterSymbolizer.js +1 -1
- package/renderers/support/rasterRendererHelper.js +1 -1
- package/rest/locator/addressToLocations.js +1 -1
- package/rest/locator/addressesToLocations.js +1 -1
- package/rest/locator/suggestLocations.js +1 -1
- package/rest/networks/support/Association.js +1 -1
- package/smartMapping/raster/support/adapters/ImageryLayerAdapter.js +1 -1
- package/smartMapping/raster/support/adapters/ImageryTileLayerAdapter.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/engine/imagery/RasterVFDisplayObject.js +1 -1
- package/views/2d/engine/webgl/cpuMapped/MappedMesh.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterRangeHighlightShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/MaskShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/RemapShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/math.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/typed/TypedShaderProgram.js +1 -1
- package/views/2d/engine/webgl/textureUtils.js +1 -1
- package/views/2d/layers/ImageryLayerView2D.js +1 -1
- package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
- package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
- package/views/2d/layers/imagery/ImageryView2D.js +1 -1
- package/views/2d/layers/imagery/VectorFieldTileView2D.js +1 -1
- package/views/2d/layers/imagery/VectorFieldView2D.js +1 -1
- package/views/3d/glTF/LoaderResult.js +1 -1
- package/views/3d/glTF/internal/Resource.js +1 -1
- package/views/3d/glTF/loader.js +1 -1
- package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/i3s/I3SGraphicsMap.js +1 -1
- package/views/3d/layers/i3s/I3SIndex.js +1 -1
- package/views/3d/support/buffer/glUtil.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatFadeTexture.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBuffer.glsl.js +10 -10
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferLayout.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBufferView.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/bufferLayouts.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/edgeProcessing.js +1 -1
- package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultLayouts.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/DrawParameters.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/Instance.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/MergedBuffer.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/PerBufferData.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/PerOriginData.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/VaoRenderer.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +9 -9
- package/views/DOMContainer.js +1 -1
- package/views/GroundView.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/layers/ImageryLayerViewMixin.js +1 -1
- package/views/layers/ImageryTileLayerViewMixin.js +1 -1
- package/views/support/imageReprojection.js +1 -1
- package/views/webgl/ShaderBuilder.js +1 -1
- package/views/webgl/Util.js +1 -1
- package/views/webgl/VertexElementDescriptor.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/BuildingExplorer/BuildingExplorerViewModel.js +1 -1
- package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
- package/widgets/CoordinateConversion.js +1 -1
- package/widgets/DirectLineMeasurement3D.js +1 -1
- package/widgets/DistanceMeasurement2D.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/ElevationProfile.js +1 -1
- package/widgets/Feature.js +1 -1
- package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
- package/widgets/FeatureTable/support/GroupColumnTemplate.js +1 -1
- package/widgets/FeatureTable/support/TableTemplate.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/FeatureTemplates.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/Legend.js +1 -1
- package/widgets/LineOfSight.js +1 -1
- package/widgets/Locate.js +1 -1
- package/widgets/OrientedImageryViewer/galleryUtils.js +1 -1
- package/widgets/OrientedImageryViewer/services/DepthImageService.js +1 -1
- package/widgets/PanoramicViewer/support/importUtils.js +1 -1
- package/widgets/Print.js +1 -1
- package/widgets/ScaleBar.js +1 -1
- package/widgets/ScaleRangeSlider.js +1 -1
- package/widgets/Search/SearchResultRenderer.js +1 -1
- package/widgets/Search/SearchViewModel.js +1 -1
- package/widgets/Search/types.js +1 -1
- package/widgets/Search.js +1 -1
- package/widgets/ShadowCast.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/VersionManagement/VersionManagementViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/0a5427127634738aa239.js +0 -1
- package/assets/esri/core/workers/chunks/110429583b28c28c36ee.js +0 -1
- package/assets/esri/core/workers/chunks/145c6a7cdcc9893efb27.js +0 -1
- package/assets/esri/core/workers/chunks/1bacdd17e199e22b5cd1.js +0 -1
- package/assets/esri/core/workers/chunks/1d566539ff6fb6ac798c.js +0 -1
- package/assets/esri/core/workers/chunks/1f6ead46b723630db897.js +0 -1
- package/assets/esri/core/workers/chunks/3a16347e17312556e02c.js +0 -1
- package/assets/esri/core/workers/chunks/478def691ae6763686f3.js +0 -1
- package/assets/esri/core/workers/chunks/4c4a55be41ba105c091c.js +0 -1
- package/assets/esri/core/workers/chunks/4cbf5a97b2b3c6553f6f.js +0 -1
- package/assets/esri/core/workers/chunks/5dc0d853c21ccb6054c7.js +0 -1
- package/assets/esri/core/workers/chunks/613cbac9cb925cd20b48.js +0 -1
- package/assets/esri/core/workers/chunks/646f58b69d2354f1ef27.js +0 -1
- package/assets/esri/core/workers/chunks/800c91302eaad7f00877.js +0 -1
- package/assets/esri/core/workers/chunks/93d11075f65a5b6625ea.js +0 -1
- package/assets/esri/core/workers/chunks/9f2a8445a5848502c7e7.js +0 -1
- package/assets/esri/core/workers/chunks/a1b08aab73747f4e7e25.js +0 -1
- package/assets/esri/core/workers/chunks/ba59568e748f0ba53b78.js +0 -1
- package/assets/esri/core/workers/chunks/c4de24582c29fda5a033.js +0 -1
- package/assets/esri/core/workers/chunks/d786b17cc9062b1450ac.js +0 -1
- package/assets/esri/core/workers/chunks/d9958654c6438f28237b.js +0 -1
- package/assets/esri/core/workers/chunks/e6fa6f9c278589c8a713.js +0 -1
- package/assets/esri/core/workers/chunks/e7f4d135ef9665de1468.js +0 -1
- package/assets/esri/core/workers/chunks/f21cb5b34d4d1e3af1a9.js +0 -1
- package/assets/esri/core/workers/chunks/f93f0586ce10cb5d98b3.js +0 -1
- package/layers/support/rasterDatasets/BaseRaster.js +0 -5
- package/layers/support/rasterDatasets/CovJSONRaster.js +0 -5
- package/layers/support/rasterDatasets/FunctionRaster.js +0 -5
- package/layers/support/rasterDatasets/ImageAuxRaster.js +0 -5
- package/layers/support/rasterDatasets/ImageServerRaster.js +0 -5
- package/layers/support/rasterDatasets/InMemoryRaster.js +0 -5
- package/layers/support/rasterDatasets/MRFRaster.js +0 -5
- package/layers/support/rasterDatasets/RawBlockCache.js +0 -5
- package/layers/support/rasterDatasets/TIFFRaster.js +0 -5
- package/layers/support/rasterDatasets/WCSRaster.js +0 -5
- package/layers/support/rasterDatasets/covJSONParser.js +0 -5
- package/layers/support/rasterDatasets/multidimensionalUtils.js +0 -5
- package/layers/support/rasterDatasets/pamParser.js +0 -5
- package/layers/support/rasterDatasets/pixelReader.js +0 -5
- package/layers/support/rasterDatasets/wcsCoverageParser.js +0 -5
- package/layers/support/rasterFormats/Lerc.js +0 -5
- package/layers/support/rasterFormats/Qb3.js +0 -5
- package/layers/support/rasterFormats/RasterCodec.js +0 -5
- package/layers/support/rasterFormats/TiffDecoder.js +0 -5
- package/layers/support/rasterFunctions/ArithmeticFunction.js +0 -5
- package/layers/support/rasterFunctions/BandArithmeticFunction.js +0 -5
- package/layers/support/rasterFunctions/BaseRasterFunction.js +0 -5
- package/layers/support/rasterFunctions/ColormapFunction.js +0 -5
- package/layers/support/rasterFunctions/ColormapToRGBFunction.js +0 -5
- package/layers/support/rasterFunctions/CompositeBandFunction.js +0 -5
- package/layers/support/rasterFunctions/CompositeBandFunctionArguments.js +0 -5
- package/layers/support/rasterFunctions/ComputeChangeFunction.js +0 -5
- package/layers/support/rasterFunctions/ConvolutionFunction.js +0 -5
- package/layers/support/rasterFunctions/ConvolutionFunctionArguments.js +0 -5
- package/layers/support/rasterFunctions/HillshadeFunction.js +0 -5
- package/layers/support/rasterFunctions/LocalFunction.js +0 -5
- package/layers/support/rasterFunctions/RemapFunction.js +0 -5
- package/layers/support/rasterFunctions/ShadedReliefFunction.js +0 -5
- package/layers/support/rasterFunctions/SlopeFunction.js +0 -5
- package/layers/support/rasterFunctions/StatisticsFunction.js +0 -5
- package/layers/support/rasterFunctions/StretchFunction.js +0 -5
- package/layers/support/rasterFunctions/bandIndexUtils.js +0 -5
- package/layers/support/rasterFunctions/changeDetectionUtils.js +0 -5
- package/layers/support/rasterFunctions/clipUtils.js +0 -5
- package/layers/support/rasterFunctions/conversionUtils.js +0 -5
- package/layers/support/rasterFunctions/convolutionUtils.js +0 -5
- package/layers/support/rasterFunctions/creators/createDataManagementFunctions.js +0 -5
- package/layers/support/rasterFunctions/creators/utils.js +0 -5
- package/layers/support/rasterFunctions/focalStatUtils.js +0 -5
- package/layers/support/rasterFunctions/localUtils.js +0 -5
- package/layers/support/rasterFunctions/pixelTransformUtils.js +0 -5
- package/layers/support/rasterFunctions/pixelUtils.js +0 -5
- package/layers/support/rasterFunctions/stretchUtils.js +0 -5
- package/layers/support/rasterFunctions/surfaceUtils.js +0 -5
- package/layers/support/rasterFunctions/vectorFieldUtils.js +0 -5
- package/layers/support/rasterTransforms/BaseRasterTransform.js +0 -5
- /package/assets/esri/layers/{support/rasterFormats → raster/formats}/lerc-wasm.wasm +0 -0
- /package/assets/esri/layers/{support/rasterFormats → raster/formats}/qb3-wasm.wasm +0 -0
- /package/layers/{support/rasterDatasets → raster/datasets}/DBFParser.js +0 -0
- /package/layers/{support/rasterDatasets → raster/datasets}/EphemeralBlockCache.js +0 -0
- /package/layers/{support/rasterDatasets → raster/datasets}/RasterFactory.js +0 -0
- /package/layers/{support/rasterDatasets → raster/datasets}/byteStreamUtils.js +0 -0
- /package/layers/{support/rasterDatasets → raster/datasets}/datasetUtils.js +0 -0
- /package/layers/{support/rasterDatasets → raster/datasets}/multipartParser.js +0 -0
- /package/layers/{support/rasterDatasets → raster/datasets}/wcsCapabilitiesParser.js +0 -0
- /package/layers/{support/rasterDatasets → raster/datasets}/xmlUtilities.js +0 -0
- /package/layers/{support/rasterFormats → raster/formats}/ImageCanvasDecoder.js +0 -0
- /package/layers/{support/rasterFormats → raster/formats}/JpgPlus.js +0 -0
- /package/layers/{support/rasterFormats → raster/formats}/Lzw.js +0 -0
- /package/layers/{support/rasterFormats → raster/formats}/Raw.js +0 -0
- /package/layers/{support/rasterFormats → raster/formats}/pixelRangeUtils.js +0 -0
- /package/layers/{support/rasterFormats → raster/formats}/tiffTag.js +0 -0
- /package/layers/{support/rasterFormats → raster/formats}/utils.js +0 -0
- /package/layers/{support/rasterFunctions → raster/functions}/colormaps.js +0 -0
- /package/layers/{support/rasterFunctions → raster/functions}/creators/createAppearenceFunctions.js +0 -0
- /package/layers/{support/rasterFunctions → raster/functions}/creators/createBandIndexFunctions.js +0 -0
- /package/layers/{support/rasterFunctions → raster/functions}/creators/createChangeFunctions.js +0 -0
- /package/layers/{support/rasterFunctions → raster/functions}/creators/createConversionFunctions.js +0 -0
- /package/layers/{support/rasterFunctions → raster/functions}/creators/createLocalFunctions.js +0 -0
- /package/layers/{support/rasterFunctions → raster/functions}/creators/createMultiRasterAnalysisFunctions.js +0 -0
- /package/layers/{support/rasterFunctions → raster/functions}/creators/createStatisticsFunctions.js +0 -0
- /package/layers/{support/rasterFunctions → raster/functions}/creators/createSurfaceFunctions.js +0 -0
- /package/layers/{support/rasterFunctions → raster/functions}/customBandIndexUtils.js +0 -0
- /package/layers/{support/rasterFunctions → raster/functions}/mirror.js +0 -0
- /package/layers/{support/rasterFunctions → raster/functions}/rasterFunctionHelper.js +0 -0
- /package/layers/{support/rasterFunctions → raster/functions}/rasterFunctionSchema.js +0 -0
- /package/layers/{support/rasterFunctions → raster/functions}/rasterProjectionHelper.js +0 -0
- /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 t from"../../../core/Error.js";import{assertIsSome as e}from"../../../core/maybe.js";import a from"./ImageCanvasDecoder.js";import i from"./JpgPlus.js";import{load as s,decode as r}from"./Lerc.js";import{decode as n}from"./Lzw.js";import{convertNoDataToMask as o}from"./pixelRangeUtils.js";import{Z as h}from"../../../chunks/Zlib.js";import{load as c,decode as l}from"./Qb3.js";import p from"./Raw.js";import{decodeTileOrStrip as d,decode as u}from"./TiffDecoder.js";import{isPlatformLittleEndian as f}from"./utils.js";import m from"../../support/PixelBlock.js";import{SimpleBandStatistics as g}from"../../support/SimpleBandStatistics.js";var w=function(t){var e,a,i,s,r,n;function o(t){var e,a,i,s,r,n,o,h,c,l,p,d,u;for(this.data=t,this.pos=8,this.palette=[],this.imgData=[],this.transparency={},this.animation=null,this.text={},r=null;;){switch(e=this.readUInt32(),h=function(){var t,e;for(e=[],t=0;t<4;++t)e.push(String.fromCharCode(this.data[this.pos++]));return e}.call(this).join(""),h){case"IHDR":this.width=this.readUInt32(),this.height=this.readUInt32(),this.bits=this.data[this.pos++],this.colorType=this.data[this.pos++],this.compressionMethod=this.data[this.pos++],this.filterMethod=this.data[this.pos++],this.interlaceMethod=this.data[this.pos++];break;case"acTL":this.animation={numFrames:this.readUInt32(),numPlays:this.readUInt32()||1/0,frames:[]};break;case"PLTE":this.palette=this.read(e);break;case"fcTL":r&&this.animation.frames.push(r),this.pos+=4,r={width:this.readUInt32(),height:this.readUInt32(),xOffset:this.readUInt32(),yOffset:this.readUInt32()},s=this.readUInt16(),i=this.readUInt16()||100,r.delay=1e3*s/i,r.disposeOp=this.data[this.pos++],r.blendOp=this.data[this.pos++],r.data=[];break;case"IDAT":case"fdAT":for("fdAT"===h&&(this.pos+=4,e-=4),t=(null!=r?r.data:void 0)||this.imgData,p=0;0<=e?p<e:p>e;0<=e?++p:--p)t.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:if(this.transparency.indexed=this.read(e),(c=255-this.transparency.indexed.length)>0)for(d=0;0<=c?d<c:d>c;0<=c?++d:--d)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(e)[0];break;case 2:this.transparency.rgb=this.read(e)}break;case"tEXt":n=(l=this.read(e)).indexOf(0),o=String.fromCharCode.apply(String,l.slice(0,n)),this.text[o]=String.fromCharCode.apply(String,l.slice(n+1));break;case"IEND":return r&&this.animation.frames.push(r),this.colors=function(){switch(this.colorType){case 0:case 3:case 4:return 1;case 2:case 6:return 3}}.call(this),this.hasAlphaChannel=4===(u=this.colorType)||6===u,a=this.colors+(this.hasAlphaChannel?1:0),this.pixelBitlength=this.bits*a,this.colorSpace=function(){switch(this.colors){case 1:return"DeviceGray";case 3:return"DeviceRGB"}}.call(this),void(this.imgData=new Uint8Array(this.imgData));default:this.pos+=e}if(this.pos+=4,this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}return o.load=function(t,e,a){var i;return"function"==typeof e&&(a=e),(i=new XMLHttpRequest).open("GET",t,!0),i.responseType="arraybuffer",i.onload=function(){var t;return t=new o(new Uint8Array(i.response||i.mozResponseArrayBuffer)),"function"==typeof(null!=e?e.getContext:void 0)&&t.render(e),"function"==typeof a?a(t):void 0},i.send(null)},a=1,i=2,e=0,o.prototype.read=function(t){var e,a;for(a=[],e=0;0<=t?e<t:e>t;0<=t?++e:--e)a.push(this.data[this.pos++]);return a},o.prototype.readUInt32=function(){return this.data[this.pos++]<<24|this.data[this.pos++]<<16|this.data[this.pos++]<<8|this.data[this.pos++]},o.prototype.readUInt16=function(){return this.data[this.pos++]<<8|this.data[this.pos++]},o.prototype.decodePixels=function(t){var e,a,i,s,r,n,o,c,l,p,d,u,f,m,g,w,y,b,x,k,T,C,I;if(null==t&&(t=this.imgData),0===t.length)return new Uint8Array(0);for(t=(t=new h(t)).getBytes(),w=(u=this.pixelBitlength/8)*this.width,f=new Uint8Array(w*this.height),n=t.length,g=0,m=0,a=0;m<n;){switch(t[m++]){case 0:for(s=x=0;x<w;s=x+=1)f[a++]=t[m++];break;case 1:for(s=k=0;k<w;s=k+=1)e=t[m++],r=s<u?0:f[a-u],f[a++]=(e+r)%256;break;case 2:for(s=T=0;T<w;s=T+=1)e=t[m++],i=(s-s%u)/u,y=g&&f[(g-1)*w+i*u+s%u],f[a++]=(y+e)%256;break;case 3:for(s=C=0;C<w;s=C+=1)e=t[m++],i=(s-s%u)/u,r=s<u?0:f[a-u],y=g&&f[(g-1)*w+i*u+s%u],f[a++]=(e+Math.floor((r+y)/2))%256;break;case 4:for(s=I=0;I<w;s=I+=1)e=t[m++],i=(s-s%u)/u,r=s<u?0:f[a-u],0===g?y=b=0:(y=f[(g-1)*w+i*u+s%u],b=i&&f[(g-1)*w+(i-1)*u+s%u]),o=r+y-b,c=Math.abs(o-r),p=Math.abs(o-y),d=Math.abs(o-b),l=c<=p&&c<=d?r:p<=d?y:b,f[a++]=(e+l)%256;break;default:throw new Error("Invalid filter algorithm: "+t[m-1])}g++}return f},o.prototype.decodePalette=function(){var t,e,a,i,s,r,n,o,h;for(a=this.palette,r=this.transparency.indexed||[],s=new Uint8Array((r.length||0)+a.length),i=0,a.length,t=0,e=n=0,o=a.length;n<o;e=n+=3)s[i++]=a[e],s[i++]=a[e+1],s[i++]=a[e+2],s[i++]=null!=(h=r[t++])?h:255;return s},o.prototype.copyToImageData=function(t,e){var a,i,s,r,n,o,h,c,l,p,d;if(i=this.colors,l=null,a=this.hasAlphaChannel,this.palette.length&&(l=null!=(d=this._decodedPalette)?d:this._decodedPalette=this.decodePalette(),i=4,a=!0),c=(s=t.data||t).length,n=l||e,r=o=0,1===i)for(;r<c;)h=l?4*e[r/4]:o,p=n[h++],s[r++]=p,s[r++]=p,s[r++]=p,s[r++]=a?n[h++]:this.transparency.grayscale&&this.transparency.grayscale===p?0:255,o=h;else for(;r<c;)h=l?4*e[r/4]:o,s[r++]=n[h++],s[r++]=n[h++],s[r++]=n[h++],s[r++]=a?n[h++]:this.transparency.rgb&&this.transparency.rgb[1]===n[h-3]&&this.transparency.rgb[3]===n[h-2]&&this.transparency.rgb[5]===n[h-1]?0:255,o=h},o.prototype.decode=function(){var t;return t=new Uint8Array(this.width*this.height*4),this.copyToImageData(t,this.decodePixels()),t},r=t.document&&t.document.createElement("canvas"),n=r&&r.getContext("2d"),s=function(t){var e;return n.width=t.width,n.height=t.height,n.clearRect(0,0,t.width,t.height),n.putImageData(t,0,0),(e=new Image).src=r.toDataURL(),e},o.prototype.decodeFrames=function(t){var e,a,i,r,n,o,h,c;if(this.animation){for(c=[],a=n=0,o=(h=this.animation.frames).length;n<o;a=++n)e=h[a],i=t.createImageData(e.width,e.height),r=this.decodePixels(new Uint8Array(e.data)),this.copyToImageData(i,r),e.imageData=i,c.push(e.image=s(i));return c}},o.prototype.renderFrame=function(t,s){var r,n,o;return r=(n=this.animation.frames)[s],o=n[s-1],0===s&&t.clearRect(0,0,this.width,this.height),(null!=o?o.disposeOp:void 0)===a?t.clearRect(o.xOffset,o.yOffset,o.width,o.height):(null!=o?o.disposeOp:void 0)===i&&t.putImageData(o.imageData,o.xOffset,o.yOffset),r.blendOp===e&&t.clearRect(r.xOffset,r.yOffset,r.width,r.height),t.drawImage(r.image,r.xOffset,r.yOffset)},o.prototype.animate=function(t){var e,a,i,s,r,n,o=this;return a=0,n=this.animation,s=n.numFrames,i=n.frames,r=n.numPlays,(e=function(){var n,h;if(n=a++%s,h=i[n],o.renderFrame(t,n),s>1&&a/s<r)return o.animation._timeout=setTimeout(e,h.delay)})()},o.prototype.stopAnimation=function(){var t;return clearTimeout(null!=(t=this.animation)?t._timeout:void 0)},o.prototype.render=function(t){var e,a;return t._png&&t._png.stopAnimation(),t._png=this,t.width=this.width,t.height=this.height,e=t.getContext("2d"),this.animation?(this.decodeFrames(e),this.animate(e)):(a=e.createImageData(this.width,this.height),this.copyToImageData(a,this.decodePixels()),e.putImageData(a,0,0))},o}(self);const y=new Set(["jpg","png","bmp","gif"]);async function b(e,a){if(!f)throw new t("rasterCoded:decode","lerc decoder is not supported on big endian platform");await s();const{offset:i}=a,{width:n,height:o,pixelType:h,statistics:c,depthCount:l,noDataValues:p,bandMasks:d,pixels:u,mask:w}=r(e,{inputOffset:i,returnInterleaved:a.returnInterleaved}),y=new m({width:n,height:o,pixelType:h.toLowerCase(),pixels:u,mask:w,statistics:c.map(({minValue:t,maxValue:e})=>new g(t,e)),bandMasks:d,depthCount:l,noDataValues:p});return c?.length||y.updateStatistics(),y}async function x(e,a){await c();const i=l(e);if(!i)throw new t("rasterCodec:decode","failed to decode the input data.");const{width:s,height:r,pixels:n}=i,o=new m({width:s,height:r,pixelType:"u16",pixels:n});return o.updateStatistics(),o}async function k(t,a){const i=await u(t,{...a,noDataValue:a.tiffNoDataValue,matchAllNoData:a.matchAllNoData});e(i);const s=new m({width:i.width,height:i.height,pixels:i.pixels,pixelType:i.pixelType.toLowerCase(),mask:i.mask,bandMasks:i.bandMasks,statistics:null});return s.updateStatistics(),s}async function T(t,e){const a=await d(t,e.customOptions),i=new m({width:a.width,height:a.height,pixels:a.pixels,pixelType:a.pixelType.toLowerCase(),mask:a.mask,statistics:null});return i.updateStatistics(),i}function C(t,e){const a=e.pixelType||"u8",i=m.getPixelArrayConstructor(a),s="u8"===a?t:new i(t.buffer),r=[],n=e.planes||1;if(1===n)r.push(s);else for(let h=0;h<n;h++){const a=(e.width||1)*(e.height||t.length),o=new i(a);for(let t=0;t<a;t++)o[t]=s[t*n+h];r.push(o)}const o=new m({width:e.width||1,height:e.height||t.length,pixels:r,pixelType:a,statistics:null});return o.updateStatistics(),o}function I(t,e){return C(new h(new Uint8Array(t)).getBytes(),e)}function A(t,e){return C(n(t,e.offset,e.eof,!e.isInputBigEndian),e)}function v(t,e,a){const{pixelTypeCtor:i}=P(e.pixelType),s=(0,p.decode)(t,{width:e.width,height:e.height,pixelType:i,format:a}),r=new m({width:e.width,height:e.height,pixels:s.pixels,pixelType:e.pixelType,mask:s.mask,statistics:null});return r.updateStatistics(),r}function D(t,e){const a=i.decode(t,e.hasNoZlibMask??void 0),s=new m({width:a.width,height:a.height,pixels:a.pixels,pixelType:"u8",mask:a.mask,statistics:null});return s.updateStatistics(),s}function U(t,e){const a=new Uint8Array(t),i=new w(a),{width:s,height:r}=e,n=s*r,o=i.decode();let h,c=0,l=0;const p=new Uint8Array(n);for(c=0;c<n;c++)p[c]=o[4*c+3];const d=new m({width:s,height:r,pixels:[],pixelType:"u8",mask:p,statistics:[]});for(c=0;c<3;c++){for(h=new Uint8Array(n),l=0;l<n;l++)h[l]=o[4*l+c];d.addData({pixels:h})}return d.updateStatistics(),d}async function S(t,e,i,s){const r=new a,n={applyJpegMask:!1,format:e,...i},o=await r.decode(t,n,s),h=new m(o);return h.updateStatistics(),h}function j(e){if(null==e)throw new t("rasterCodec:decode","parameter encodeddata is required.");const a=new Uint8Array(e,0,10);let i="";return 255===a[0]&&216===a[1]?i="jpg":137===a[0]&&80===a[1]&&78===a[2]&&71===a[3]?i="png":67===a[0]&&110===a[1]&&116===a[2]&&90===a[3]&&73===a[4]&&109===a[5]&&97===a[6]&&103===a[7]&&101===a[8]&&32===a[9]?i="lerc":76===a[0]&&101===a[1]&&114===a[2]&&99===a[3]&&50===a[4]&&32===a[5]?i="lerc2":73===a[0]&&73===a[1]&&42===a[2]&&0===a[3]||77===a[0]&&77===a[1]&&0===a[2]&&42===a[3]||73===a[0]&&73===a[1]&&43===a[2]&&0===a[3]||77===a[0]&&77===a[1]&&0===a[2]&&43===a[3]?i="tiff":71===a[0]&&73===a[1]&&70===a[2]?i="gif":66===a[0]&&77===a[1]?i="bmp":81===a[0]&&66===a[1]&&51===a[2]?i="qb3":String.fromCharCode.apply(null,a).toLowerCase().includes("error")&&(i="error"),i}function O(e){let a=null;switch(e){case"lerc":case"lerc2":a=b;break;case"jpg":a=D;break;case"png":a=U;break;case"bsq":case"bip":a=(t,a)=>v(t,a,e);break;case"tiff":a=k;break;case"deflate":a=I;break;case"lzw":a=A;break;case"qb3":a=x;break;case"error":a=()=>{throw new t("rasterCodec:decode","input data contains error")};break;default:a=()=>{throw new t("rasterCodec:decode","unsupported raster format")}}return a}function P(t){let e=null,a=null;switch(t?t.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":a=255,e=Uint8Array;break;case"u16":a=a||65535,e=Uint16Array;break;case"u32":a=a||2**32-1,e=Uint32Array;break;case"s8":a=a||-128,e=Int8Array;break;case"s16":a=a||-32768,e=Int16Array;break;case"s32":a=a||0-2**31,e=Int32Array;break;default:e=Float32Array}return{pixelTypeCtor:e,noDataValue:a}}function M(t,e=1){if(!t)return;const{pixels:a,width:i,height:s,mask:r}=t;if(!a||0===a.length)return;const n=a.length,o=i-1,h=s-1,c=[];let l,p,d,u,f,g,w=null;const y=m.getPixelArrayConstructor(t.pixelType);if(0===e){for(l=0;l<n;l++){for(f=a[l],g=new y(o*h),p=0;p<h;p++)for(u=p*i,d=0;d<o;d++)g[p*o+d]=f[u+d];c.push(g)}if(null!=r)for(w=new Uint8Array(o*h),p=0;p<h;p++)for(u=p*i,d=0;d<o;d++)w[p*o+d]=r[u+d]}else{for(l=0;l<n;l++){for(f=a[l],g=new y(o*h),p=0;p<h;p++)for(u=p*i,d=0;d<o;d++)g[p*o+d]=(f[u+d]+f[u+d+1]+f[u+i+d]+f[u+i+d+1])/4;c.push(g)}if(r)for(w=new Uint8Array(o*h),p=0;p<h;p++)for(u=p*i,d=0;d<o;d++)w[p*o+d]=Math.min.apply(null,[r[u+d],r[u+d+1],r[u+i+d],r[u+i+d+1]])}t.width=o,t.height=h,t.mask=w,t.pixels=c}function L(t){let e=j(t);return"lerc2"===e?e="lerc":"error"===e&&(e=""),e}async function R(e,a={},i){if(null==e)throw new t("rasterCodec:decode","missing encodeddata parameter.");let s=a.format?.toLowerCase();if(!("bsq"!==s&&"bip"!==s||null!=a.width&&null!=a.height))throw new t("rasterCodec:decode","requires width and height in options parameter.");if("tiff"===s&&a.customOptions)return T(e,a);if((!s||"bsq"!==s&&"bip"!==s&&"deflate"!==s&&"lzw"!==s)&&(s=j(e)),a.useCanvas&&y.has(s))return S(e,s,a,i);const r=O(s);let n;a.isPoint&&(null!=(a={...a}).width&&a.width++,null!=a.height&&a.height++);const{offsets:h}=a;if(h&&h.length>1){const t=h.map((t,i)=>r(e.slice(t,h[i+1]),a)),i=await Promise.all(t);n=i[0],n.pixels=i.map(t=>t.pixels[0]);const s=i.map(t=>t.mask);i.some(t=>null!=t)&&(s.forEach((t,e)=>{null==t&&(s[e]=new Uint8Array(n.width*n.height).fill(255))}),n.bandMasks=s,n.mask=m.combineBandMasks(s)),n.updateStatistics()}else n=await r(e,{...a,offset:h?.[0]??a.offset});return"jpg"!==s&&null!=a.noDataValue&&1===n.depthCount&&o(n,a.noDataValue,{customFloatTolerance:a.tolerance}),a.isPoint&&M(n),n}export{R as decode,L as getFormat};
|
|
@@ -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{bytesToUTF8 as e}from"../datasets/byteStreamUtils.js";import{J as t}from"../../../chunks/Jpg.js";import{load as n,decode as a}from"./Lerc.js";import{decode as i}from"./Lzw.js";import{convertNoDataToMask as r}from"./pixelRangeUtils.js";import{tiffTags as s,ifdTags as l,getTagName as o,geoKeys as f}from"./tiffTag.js";import{isPlatformLittleEndian as u}from"./utils.js";import{Z as c}from"../../../chunks/Zlib.js";const h=[0,1,1,2,4,8,1,1,2,4,8,4,8,-1,-1,-1,8,8,8],g=4294967296,E=new Set([1,5,6,7,8,34712,34887]);function I(e,t){let n="unknown";return 3===e?n=64===t?"f64":"f32":1===e?1===t?n="u1":2===t?n="u2":4===t?n="u4":t<=8?n="u8":t<=16?n="u16":t<=32&&(n="u32"):2===e&&(t<=8?n="s8":t<=16?n="s16":t<=32&&(n="s32")),n}function T(e){let t=null;switch(e?e.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":t=Uint8Array;break;case"u16":t=Uint16Array;break;case"u32":t=Uint32Array;break;case"s8":t=Int8Array;break;case"s16":t=Int16Array;break;case"s32":t=Int32Array;break;case"f64":t=Float64Array;break;default:t=Float32Array}return t}function w(e,t){return{x:t[0]*e.x+t[1]*e.y+t[2],y:t[3]*e.x+t[4]*e.y+t[5]}}function p(e,t){return e.get(t)?.values}function d(e,t){return e.get(t)?.values}function m(e,t){return e.get(t)?.values?.[0]}function y(e,t){return e.get(t)?.values?.[0]}function A(e,t,n,a=0,i=s,r=4){const l=8===r,f=l?B(new DataView(e,n,8),0,t):new DataView(e,n,2).getUint16(0,t),u=4+2*r,c=l?8:2,h=c+f*u;if(n+h>e.byteLength)return{success:!1,ifd:null,nextIFD:null,requiredBufferSize:h};const g=8===r?8:4,E=n+h+g<=e.byteLength?W(new DataView(e,n+h,g),0,t,8===r):null,I=n+c,T=new Map;let w,p,d,m,y,A=0,S=0;for(let s=0;s<f;s++){p=new DataView(e,I+u*s,u),d=p.getUint16(0,t),y=p.getUint16(2,t),m=o(d,i);const n=[];2===r?(A=p.getUint16(4,t),S=p.getUint16(6,t)):4===r?(A=p.getUint32(4,t),S=p.getUint32(8,t)):8===r&&(A=W(p,4,t,!0),S=W(p,12,t,!0),n.push(p.getUint32(12,t)),n.push(p.getUint32(16,t))),w={id:d,type:y,valueCount:A,valueOffset:S,valueOffsets:n,values:null},N(e,t,w,a,!1,r),T.set(m,w)}return{success:!0,ifd:T,nextIFD:E,requiredBufferSize:h}}const S=(e,t)=>a(e,{inputOffset:t}).pixels[0];function M(e,t){if(t%8==0)return e;const n=t>16?32:t>8?16:8;n>8&&(e=b(e,32===n?4:2));const a=32===n?Uint32Array:16===n?Uint16Array:Uint8Array,i=new a(e),r=Math.floor(8*e.byteLength/t+1e-6),s=new a(r),l=(1<<t)-1;let o=0,f=0,u=0;for(let c=0;c<r;c++)if(0===f&&(u=i[o++],f=n),f>=t)s[c]=u>>>f-t&l,f-=t;else{const e=t-f;let a=(u&l)<<e&l;u=i[o++],f=n-e,a+=u>>>f,s[c]=a}return s.buffer}function P(e,n,a){const i=new t;i.parse(e),i.colorTransform=6===a?-1:0;const r=i.getData(i.width,i.height,1!==n&&4!==n);return new Uint8Array(r.buffer)}function O(e){const t=new c(e).getBytes(),n=new ArrayBuffer(t.length),a=new Uint8Array(n);return a.set(t),a}function b(e,t){const n=new Uint8Array(e),a=new Uint8Array(n.length);if(2===t)for(let i=0;i<n.length;i+=2)a[i]=n[i+1],a[i+1]=n[i];else if(4===t)for(let i=0;i<n.length;i+=4)a[i]=n[i+3],a[i+1]=n[i+2],a[i+2]=n[i+1],a[i+3]=n[i];else for(let i=0;i<n.length;i+=8)a[i]=n[i+7],a[i+1]=n[i+6],a[i+2]=n[i+5],a[i+3]=n[i+4],a[i+4]=n[i+3],a[i+5]=n[i+2],a[i+6]=n[i+1],a[i+7]=n[i];return a.buffer}async function x(e,t,a,r,s){const l=u===t,o=y(a,"BITSPERSAMPLE"),f=y(a,"SAMPLESPERPIXEL")??1,c=y(a,"PHOTOMETRICINTERPRETATION"),h=y(a,"SAMPLEFORMAT")??1,g=I(h,o),E=y(a,"COMPRESSION")??1,w=T(g);let p,d,m;if(34887===E)return await n(),S(e,r);if(1===E)p=e.slice(r,r+s),d=new Uint8Array(p);else if(8===E||32946===E)d=new Uint8Array(e,r,s),d=O(d),p=d.buffer;else if(6===E)d=new Uint8Array(e,r,s),d=P(d,f,c),p=d.buffer;else if(7===E){const t=a.get("JPEGTABLES").values,n=t.length-2;d=new Uint8Array(n+s-2);for(let e=0;e<n;e++)d[e]=t[e];const i=new Uint8Array(e,r+2,s-2);for(let e=0;e<i.length;e++)d[n+e]=i[e];d=P(d,f,c),p=d.buffer}else{if(5!==E)throw new Error("tiff-decode: unsupport compression "+E);d=i(e,r,s,t),p=d.buffer}if(p=M(p,o),l||o<=8)m=new w(p);else{const e=o>32?8:o>16?4:2;m=new w(b(d.buffer,e))}const A=y(a,"PREDICTOR")??1,x=y(a,"TILEWIDTH"),L=y(a,"TILELENGTH");if(A>1&&(5===E||8===E||32946===E)&&x&&L){const e=C(a),t=new w(m.length);t.set(m),m=j(t,L,x,3===h&&3===A,e?1:f)}return m}async function L(e,t,n){const a=d(n,"TILEOFFSETS");if(void 0===a)return null;const i=d(n,"TILEBYTECOUNTS"),{width:r,height:s,pixelType:l,tileWidth:o,tileHeight:f}=k([n]),u=C(n,t),c=y(n,"SAMPLESPERPIXEL")||t.planes,h=r*s,g=y(n,"BITSPERSAMPLE"),E=34887===(y(n,"COMPRESSION")??1),I=T(l),w=[];for(let T=0;T<c;T++)w.push(new I(h));let p,m,A,S,M,P,O,b,L,R,D,U,N;const G=Math.ceil(r/o),v=new Uint8Array(h).fill(255);let F=!1;if(g%8==0)if(E&&u&&c>1){const l=Math.round(a.length/c);for(p=0;p<l;p++){P=Math.floor(p/G)*f,O=p%G*o,b=P*r+O;for(let l=0;l<c;l++){const u=p*c+l;for(0===i[u]?(A=null,F=!0):A=await x(e,t.littleEndian,n,a[u],i[u]),R=0,L=b,U=Math.min(o,r-O),D=Math.min(f,s-P),N=w[l],S=0;S<D;S++)for(L=b+S*r,R=S*o,M=0;M<U;M++,L++,R++)A?N[L]=A[R]:v[L]=0}}}else for(p=0;p<a.length;p++)for(P=Math.floor(p/G)*f,O=p%G*o,b=P*r+O,0===i[p]?(A=null,F=!0):A=await x(e,t.littleEndian,n,a[p],i[p]),R=0,L=b,U=Math.min(o,r-O),D=Math.min(f,s-P),m=0;m<c;m++)if(N=w[m],u||E)for(S=0;S<D;S++)for(L=b+S*r,R=o*f*m+S*o,M=0;M<U;M++,L++,R++)A?N[L]=A[R]:v[L]=0;else for(S=0;S<D;S++)for(L=b+S*r,R=S*o*c+m,M=0;M<U;M++,L++,R+=c)A?N[L]=A[R]:v[L]=0;return{width:r,height:s,pixelType:l,pixels:w,mask:F?v:void 0}}const R=(e,t,n)=>{const a=u===t.littleEndian,r=d(n,"STRIPOFFSETS");if(void 0===r)return null;const{width:s,height:l,pixelType:o}=k([n]),f=y(n,"SAMPLESPERPIXEL")||t.planes,c=y(n,"PHOTOMETRICINTERPRETATION"),h=s*l,g=y(n,"BITSPERSAMPLE"),E=T(o),I=new E(h*f),w=d(n,"STRIPBYTECOUNTS"),p=y(n,"ROWSPERSTRIP"),m=y(n,"COMPRESSION")??1;let A,S,b,x,L,R,D,U,N;if(g%8==0)for(A=0;A<r.length;A++){if(L=A*(p*s)*f,"u8"===o||"s8"===o||a)8===m||32946===m?(D=new Uint8Array(e,r[A],w[A]),D=O(D),R=D.buffer):6===m?(D=new Uint8Array(e,r[A],w[A]),D=P(D,f,c),R=D.buffer):5===m?(D=i(e,r[A],w[A],t.littleEndian),R=D.buffer):R=e.slice(r[A],r[A]+w[A]),R=M(R,g),x=new E(R);else{switch(6===m||8===m||32946===m?(D=new Uint8Array(e,r[A],w[A]),U=O(D),R=U.buffer):(R=new ArrayBuffer(w[A]),D=new Uint8Array(e,r[A],w[A]),U=new Uint8Array(R)),o){case"u16":case"s16":for(b=0;b<D.length;b+=2)U[b]=D[b+1],U[b+1]=D[b];break;case"u32":case"s32":case"f32":for(b=0;b<D.length;b+=4)U[b]=D[b+3],U[b+1]=D[b+2],U[b+2]=D[b+1],U[b+3]=D[b]}R=M(R,g),x=new E(R)}I.set(x,L)}const C=[];if(1===f)C.push(I);else for(A=0;A<f;A++){for(N=new E(h),S=0;S<h;S++)N[S]=I[S*f+A];C.push(N)}return{width:s,height:l,pixelType:o,pixels:C}},D=(e,t,n)=>{if(!(e&&e.length>0&&t&&n))return null;let a,i,r;const s=e[0].length,l=e.length,o=new Uint8Array(s);for(let f=0;f<l;f++)if(a=e[f],i=t[f],r=n[f],0===f)for(let e=0;e<s;e++)o[e]=a[e]<i||a[e]>r?0:1;else for(let e=0;e<s;e++)o[e]&&(o[e]=a[e]<i||a[e]>r?0:1);return o},U=e=>{if(!e)return null;const t=e.match(/<Item(.*?)Item>/gi);if(!t||0===t.length)return null;const n=new Map;let a,i,r,s,l;for(let w=0;w<t.length;w++)a=t[w],i=a.slice(6,a.indexOf(">")),s=a.indexOf("sample="),s>-1&&(l=a.slice(s+8,a.indexOf('"',s+8))),s=a.indexOf("name="),s>-1&&(i=a.slice(s+6,a.indexOf('"',s+6))),i&&(r=a.slice(a.indexOf(">")+1,a.indexOf("</Item>")).trim(),null!=l?n.has(i)?n.get(i)[l]=r:n.set(i,[r]):n.set(i,r)),l=null;const o=n.get("STATISTICS_MINIMUM"),f=n.get("STATISTICS_MAXIMUM"),u=n.get("STATISTICS_MEAN"),c=n.get("STATISTICS_STDDEV");let h=null;if(o&&f){h=[];for(let e=0;e<o.length;e++)h.push({min:parseFloat(o[e]),max:parseFloat(f[e]),avg:u&&parseFloat(u[e]),stddev:c&&parseFloat(c[e])})}const g=n.get("BandName"),E=n.get("WavelengthMin"),I=n.get("WavelengthMax");let T=null;if(g){T=[];for(let e=0;e<g.length;e++)T.push({BandName:g[e],WavelengthMin:E&&parseFloat(E[e]),WavelengthMax:I&&parseFloat(I[e])})}return{statistics:h,bandProperties:T,dataType:n.get("DataType"),rawMetadata:n}};function N(e,t,n,a=0,i=!1,r=4){if(n.values)return!0;const s=n.type,l=n.valueCount;let o=n.valueOffset,f=[];const u=h[s],c=8*u,E=l*u,I=l*h[s]*8;let T,w;const p=8===r?64:32,d=n.valueOffsets;if(I>p){if(E>(i?e.byteLength:e?e.byteLength-o+a:0))return n.offlineOffsetSize=[o,E],n.values=null,!1}if(I<=p){if(!t)if(p<=32)o>>>=32-I;else{const e=d?.length?d[0]:o>>>0,t=d?.length?d[1]:Math.round((o-e)/g);I<=32?(o=e>>>32-I,d[0]=o):(o=e*2**(32-I)+(t>>>32-I),d[0]=e,d[1]=t>>>32-I)}if(1===l&&c===p)f=[o];else if(64===p){const e=d?.length?d[0]:o>>>0,t=d?.length?d[1]:Math.round((o-e)/g);let n=e,a=32;for(w=1;w<=l;w++){const e=32-c*w%32;if(a<c){const i=n<<e>>>32-a,r=t<<32-a>>>32-a;n=t,f.push(i+r*2**(c-a)),a-=32-(c-a)}else f.push(n<<e>>>32-c),a-=c;0===a&&(a=32,n=t)}}else for(w=1;w<=l;w++){const e=32-c*w;f.push(o<<e>>>32-c)}}else{o-=a,i&&(o=0);for(let n=o;n<o+E;n+=u){switch(s){case 1:case 2:case 7:T=new DataView(e,n,1).getUint8(0);break;case 3:T=new DataView(e,n,2).getUint16(0,t);break;case 4:case 13:T=new DataView(e,n,4).getUint32(0,t);break;case 5:T=new DataView(e,n,4).getUint32(0,t)/new DataView(e,n+4,4).getUint32(0,t);break;case 6:T=new DataView(e,n,1).getInt8(0);break;case 8:T=new DataView(e,n,2).getInt16(0,t);break;case 9:T=new DataView(e,n,4).getInt32(0,t);break;case 10:T=new DataView(e,n,4).getInt32(0,t)/new DataView(e,n+4,4).getInt32(0,t);break;case 11:T=new DataView(e,n,4).getFloat32(0,t);break;case 12:T=new DataView(e,n,8).getFloat64(0,t);break;case 16:case 18:T=B(new DataView(e,n,8),0,t);break;case 17:T=V(new DataView(e,n,8),0,t);break;default:T=null}f.push(T)}}if(2===s){let e="";const t=f;for(f=[],w=0;w<t.length;w++)0===t[w]&&""!==e?(f.push(e),e=""):e+=String.fromCharCode(t[w]);""===e&&0!==f.length||f.push(e)}return n.values=f,!0}function k(e){const t=e[0],n=y(t,"TILEWIDTH"),a=y(t,"TILELENGTH"),i=y(t,"IMAGEWIDTH"),r=y(t,"IMAGELENGTH"),s=y(t,"BITSPERSAMPLE"),l=y(t,"SAMPLESPERPIXEL"),o=y(t,"SAMPLEFORMAT")??1,f=I(o,s),u=C(t),c=p(t,"GDAL_NODATA");let h=null;c?.length&&(h=c.map(e=>parseFloat(e)),h.some(e=>isNaN(e))&&(h=null));const g=y(t,"COMPRESSION")??1;let T;switch(g){case 1:T="NONE";break;case 2:case 3:case 4:case 32771:T="CCITT";break;case 5:T="LZW";break;case 6:case 7:T="JPEG";break;case 32773:T="PACKBITS";break;case 8:case 32946:T="DEFLATE";break;case 34712:T="JPEG2000";break;case 34887:T="LERC";break;default:T=String(g)}let A=!0,S="";E.has(g)||(A=!1,S+="unsupported tag compression "+g),o>3&&(A=!1,S+="unsupported tag sampleFormat "+o),s>32&&64!==s&&(A=!1,S+="unsupported tag bitsPerSample "+s);const M=m(t,"GEOASCIIPARAMS");let P;if(M){const e=M.split("|").find(e=>e.includes("ESRI PE String = ")),t=e?e.replace("ESRI PE String = ",""):"";P=t.startsWith("COMPD_CS")||t.startsWith("PROJCS")||t.startsWith("GEOGCS")?{wkid:null,wkt:t}:null}const O=d(t,"GEOTIEPOINTS"),b=d(t,"GEOPIXELSCALE"),x=d(t,"GEOTRANSMATRIX"),L=t.has("GEOKEYDIRECTORY")?t.get("GEOKEYDIRECTORY").data:null;let R,D,N=!1,k=!1;if(L){N=2===y(L,"GTRasterTypeGeoKey");const e=y(L,"GTModelTypeGeoKey");if(2===e){const e=y(L,"GeographicTypeGeoKey");e>=1024&&e<=32766&&(P={wkid:e}),P||32767!==e||(k=!0,P={wkid:4326})}else if(1===e){const e=y(L,"ProjectedCSTypeGeoKey");e>=1024&&e<=32766&&(P={wkid:e})}}if(b&&O&&O.length>=6?(R=[b[0],0,O[3]-O[0]*b[0],0,-Math.abs(b[1]),O[4]-O[1]*b[1]],N&&(R[2]-=.5*R[0]+.5*R[1],R[5]-=.5*R[3]+.5*R[4])):x&&16===x.length&&(R=N?[x[0],x[1],x[3]-.5*x[0],x[4],x[5],x[7]-.5*x[5]]:[x[0],x[1],x[3],x[4],x[5],x[7]]),R){const e=[{x:0,y:r},{x:0,y:0},{x:i,y:r},{x:i,y:0}];let t,n=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY;for(let i=0;i<e.length;i++)t=w(e[i],R),n=t.x>n?n:t.x,s=t.x<s?s:t.x,a=t.y>a?a:t.y,l=t.y<l?l:t.y;D={xmin:n,xmax:s,ymin:a,ymax:l,spatialReference:P}}else D={xmin:-.5,ymin:.5-r,xmax:i-.5,ymax:.5,spatialReference:P};k&&(D.xmax-D.xmin>400||Math.max(Math.abs(D.xmin),Math.abs(D.xmax))>361)&&(P=null,D.spatialReference=null);const F=G(e);let B,V,W,H,Y;if(F.length>0){W=Math.round(Math.log(i/y(F[0],"IMAGEWIDTH"))/Math.LN2);const e=F[F.length-1];H=F.length,B=y(e,"TILEWIDTH"),V=y(e,"TILELENGTH")}B=null!=H&&H>0?B||n:null,V=null!=H&&H>0?V||a:null,n&&(Y=[{maxCol:Math.ceil(i/n)-1,maxRow:Math.ceil(r/a)-1,minRow:0,minCol:0}],F.forEach(e=>{Y.push({maxCol:Math.ceil(y(e,"IMAGEWIDTH")/y(e,"TILEWIDTH"))-1,maxRow:Math.ceil(y(e,"IMAGELENGTH")/y(e,"TILELENGTH"))-1,minRow:0,minCol:0})}));const j=m(e[0],"GDAL_METADATA"),X=U(j);S+=" "+_({width:i,height:r,tileWidth:n,tileHeight:a,planes:l,ifds:e});const K=v(e).length===F.length+1,J=F?.length?F.map(e=>({x:i/y(e,"IMAGEWIDTH"),y:r/y(e,"IMAGELENGTH")})):void 0;return{width:i,height:r,tileWidth:n,tileHeight:a,planes:l,isBSQ:u,pixelType:f,compression:T,noData:h,hasMaskBand:K,isSupported:A,pyramidResolutions:J,message:S,extent:D,isPseudoGeographic:k,affine:b?null:R,firstPyramidLevel:W,maximumPyramidLevel:H,pyramidBlockWidth:B,pyramidBlockHeight:V,tileBoundary:Y,metadata:X}}function C(e,t){const n=p(e,"PLANARCONFIGURATION");return n?2===n[0]:!!t&&t.isBSQ}function G(e){return e.filter(e=>1===y(e,"NEWSUBFILETYPE"))}function v(e){return e.filter(e=>{const t=!(4&~(y(e,"NEWSUBFILETYPE")??0)),n=4===y(e,"PHOTOMETRICINTERPRETATION");return t&&n})}function F(e){const{littleEndian:t,isBigTiff:n,firstIFDPos:a}=H(e);let i=a;const r=[];do{const a=Y(e,t,i,0,s,n?8:4);if(!a.success)break;r.push(a.ifd),i=a.nextIFD}while(i>0);return{...k(r),littleEndian:t,isBigTiff:n,ifds:r,pyramidIFDs:G(r),maskIFDs:v(r)}}function B(e,t,n){const a=e.getUint32(t,n),i=e.getUint32(t+4,n);return n?i*g+a:a*g+i}function V(e,t,n){let a=n?e.getInt32(t,n):e.getUint32(t,n),i=n?e.getUint32(t+4,n):e.getInt32(t+4,n);const r=(n?a:i)>=0?1:-1;n?a*=r:i*=r;return r*(n?i*g+a:a*g+i)}function W(e,t,n,a){return a?B(e,t,n):e.getUint32(t,n)}function H(e){const t=new DataView(e,0,16),n=t.getUint16(0,!1);let a=null;if(18761===n)a=!0;else{if(19789!==n)throw new Error("unexpected endianess byte");a=!1}const i=t.getUint16(2,a);if(42!==i&&43!==i)throw new Error("unexpected tiff identifier");let r=4;const s=43===i;if(s){const e=t.getUint16(r,a);if(r+=2,8!==e)throw new Error("unsupported bigtiff version");if(0!==t.getUint16(r,a))throw new Error("unsupported bigtiff version");r+=2}return{littleEndian:a,isBigTiff:s,firstIFDPos:W(t,r,a,s)}}function Y(t,n,a,i=0,r=s,o=4){const u=A(t,n,a,i,r,o);let c;const h=u.ifd;if(h){if(l.forEach((e,a)=>{h.has(a)&&(c=h.get(a),c.data=A(t,n,c.valueOffset-i,i,e).ifd)}),h.has("GEOKEYDIRECTORY")){c=h.get("GEOKEYDIRECTORY");const e=c.values;if(e&&e.length>4){const a=e[0]+"."+e[1]+"."+e[2];c.data=A(t,n,c.valueOffset+6-i,i,f,2).ifd,c.data&&c.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[a]})}}if(h.has("XMP")){c=h.get("XMP");const t=c.values;"number"==typeof t[0]&&7===c.type&&(c.values=[e(new Uint8Array(t))])}}return u}function _(e){const{width:t,height:n,tileHeight:a,tileWidth:i}=e,r=e.planes,s=i?i*a:t*n,l=y(e.ifds[0],"BITSPERSAMPLE");let o="";return s*r>2**30/(l>8?l/8:1)&&(o=i?"tiled tiff exceeding 1 gigabits per tile is not supported":"scanline tiff exceeding 1 gigabits is not supported"),o}function j(e,t,n,a,i){const r=a?4:1,s=n*r*i;a&&(e=new Uint8Array(e.buffer));for(let f=0;f<t;f++){const t=f*s;for(let n=i;n<s;n++)e[t+n]+=e[t+n-i]}if(!a)return e;const l=new Uint8Array(e.length),o=n*i;for(let f=0;f<t;f++){const t=f*s;for(let n=0;n<o;n++)for(let a=0;a<r;a++)l[t+n*r+a]=e[t+n+(r-a-1)*o]}return new Float32Array(l.buffer)}async function X(e,t){const{headerInfo:n,ifd:a,offsets:i,sizes:s}=t,l=[];for(let r=0;r<i.length;r++){s[r];const t=await x(e,n.littleEndian,a,i[r],s[r]||e.byteLength);l.push(t)}const o=C(a,n),f=y(a,"BITSPERSAMPLE"),u=I(y(a,"SAMPLEFORMAT")??1,f),c=y(a,"SAMPLESPERPIXEL")||n.planes,h=T(u),g=y(a,"TILEWIDTH"),E=y(a,"TILELENGTH"),w=y(a,"COMPRESSION")??1,p=g*E;let d;const m=[];let A=l[0];const S=34887===w;for(let r=0;r<c;r++){if(d=new h(p),l.length===c)A=l[r],A.length===p&&(d=A);else if(A.length)if(o||S)d=A.length===p?A:A.slice(p*r,p*(r+1));else for(let e=0;e<p;e++)d[e]=A[e*c+r];m.push(d)}const M=n.noData?n.noData[0]:t.noDataValue,P=n.metadata?n.metadata.statistics:null,O=P?P.map(e=>e.min):null,b=P?P.map(e=>e.max):null,L={pixelType:u,width:g,height:E,pixels:m,noDataValue:M};return null!=M?r(L,M,{matchAllNoData:t?.matchAllNoData}):O&&b&&t.applyMinMaxConstraint&&(L.mask=D(m,O,b)),L}async function K(e,t={}){const n=t.pyramidLevel||0,a=t.headerInfo||F(e),{ifds:i,noData:s}=a;if(0===i.length)throw new Error("no valid image file directory");const l=_(a);if(l)throw l;let o=null;const f=-1===n?i[i.length-1]:i[n],u=s??t.noDataValue;if(o=a.tileWidth?await L(e,a,f):R(e,a,f),!o)return o;if(null!=u){r(o,u,{matchAllNoData:null==s&&t?.matchAllNoData})}return o}export{K as decode,X as decodeTileOrStrip,k as getImageInfo,v as getMaskIFDs,G as getPyramidIFDs,C as isBSQConfig,N as parseFieldValues,F as parseHeader,Y as parseIFD,H as parseSignature,M as unpackBits};
|
|
@@ -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{getPixelValueRange as r,isIntegerPixelType as o}from"../formats/pixelRangeUtils.js";import i from"./ArithmeticFunctionArguments.js";import n from"./BaseRasterFunction.js";import{arithmetic as u}from"./localUtils.js";let p=class extends n{constructor(){super(...arguments),this.functionName="Arithmetic",this.functionArguments=null,this.rasterArgumentNames=["raster","raster2"]}_bindSourceRasters(){const{operation:t}=this.functionArguments;if(t<1||t>6)return{success:!1,supportsGPU:!1,error:"unsupported operation"};const e=this.sourceRasterInfos[0].clone();this.outputPixelType=this._getOutputPixelType(e.pixelType),e.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(e),this.rasterInfo=e;return{success:!0,supportsGPU:e.bandCount<=3}}_processPixels(t){const{pixelBlocks:e}=t;return null==e?.[0]||null==e?.[1]?null:u(e,this.functionArguments.operation,this.outputPixelType)}_getWebGLParameters(){const{operation:t}=this.functionArguments,e=["","plus","minus","times","divide","power","mod"][t],s=this.outputPixelType??"f32";let[i,n]=r(s);const u=o(s);return u&&(i-=1e-4,n+=1e-4),{imageCount:2,operationName:e,domainRange:[i,n],isOutputRounded:u}}};t([e({json:{write:!0,name:"rasterFunction"}})],p.prototype,"functionName",void 0),t([e({type:i,json:{write:!0,name:"rasterFunctionArguments"}})],p.prototype,"functionArguments",void 0),t([e()],p.prototype,"rasterArgumentNames",void 0),p=t([s("esri.layers.raster.functions.ArithmeticFunction")],p);const a=p;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{property as t,subclass as
|
|
5
|
+
import{__decorate as r}from"tslib";import{property as t,subclass as e}from"../../../core/accessorSupport/decorators.js";import s from"./BaseFunctionArguments.js";var o;let i=o=class extends s{constructor(){super(...arguments),this.raster2=void 0}get rasters(){return[this.raster,this.raster2]}clone(){return new o({raster:this.raster,raster2:this.raster2,operation:this.operation})}};r([t({json:{write:!0}})],i.prototype,"operation",void 0),r([t({json:{write:!0}})],i.prototype,"raster2",void 0),r([t({readOnly:!0})],i.prototype,"rasters",null),i=o=r([e("esri.layers.raster.functions.ArithmeticFunctionArguments")],i);const a=i;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{property as s,subclass as e}from"../../../core/accessorSupport/decorators.js";import r from"./AspectFunctionArguments.js";import o from"./BaseRasterFunction.js";import{aspect as i}from"./surfaceUtils.js";let n=class extends o{constructor(){super(...arguments),this.functionName="Aspect",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){const t=this.sourceRasterInfos[0];this.isGCS=t.spatialReference?.isGeographic??!1,this.outputPixelType=this._getOutputPixelType("f32");const s=t.clone();return s.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(s),s.statistics=[{min:-1,max:360,avg:180,stddev:30}],s.bandCount=1,this.rasterInfo=s,{success:!0,supportsGPU:!0}}_processPixels(t){const s=t.pixelBlocks?.[0];if(null==s)return null;const{extent:e,primaryPixelSizes:r}=t,o=r?.[0],n=o??(e?{x:e.width/s.width,y:e.height/s.height}:{x:1,y:1});return i(s,{resolution:n})}};t([s({json:{write:!0,name:"rasterFunction"}})],n.prototype,"functionName",void 0),t([s({type:r,json:{write:!0,name:"rasterFunctionArguments"}})],n.prototype,"functionArguments",void 0),t([s()],n.prototype,"rasterArgumentNames",void 0),t([s({json:{write:!0}})],n.prototype,"isGCS",void 0),n=t([e("esri.layers.
|
|
5
|
+
import{__decorate as t}from"tslib";import{property as s,subclass as e}from"../../../core/accessorSupport/decorators.js";import r from"./AspectFunctionArguments.js";import o from"./BaseRasterFunction.js";import{aspect as i}from"./surfaceUtils.js";let n=class extends o{constructor(){super(...arguments),this.functionName="Aspect",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){const t=this.sourceRasterInfos[0];this.isGCS=t.spatialReference?.isGeographic??!1,this.outputPixelType=this._getOutputPixelType("f32");const s=t.clone();return s.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(s),s.statistics=[{min:-1,max:360,avg:180,stddev:30}],s.bandCount=1,this.rasterInfo=s,{success:!0,supportsGPU:!0}}_processPixels(t){const s=t.pixelBlocks?.[0];if(null==s)return null;const{extent:e,primaryPixelSizes:r}=t,o=r?.[0],n=o??(e?{x:e.width/s.width,y:e.height/s.height}:{x:1,y:1});return i(s,{resolution:n})}};t([s({json:{write:!0,name:"rasterFunction"}})],n.prototype,"functionName",void 0),t([s({type:r,json:{write:!0,name:"rasterFunctionArguments"}})],n.prototype,"functionArguments",void 0),t([s()],n.prototype,"rasterArgumentNames",void 0),t([s({json:{write:!0}})],n.prototype,"isGCS",void 0),n=t([e("esri.layers.raster.functions.AspectFunction")],n);const u=n;export{u 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 s}from"../../../core/accessorSupport/decorators.js";import t from"./BaseFunctionArguments.js";var e;let o=e=class extends t{clone(){return new e({raster:this.raster})}};o=e=r([s("esri.layers.
|
|
5
|
+
import{__decorate as r}from"tslib";import{subclass as s}from"../../../core/accessorSupport/decorators.js";import t from"./BaseFunctionArguments.js";var e;let o=e=class extends t{clone(){return new e({raster:this.raster})}};o=e=r([s("esri.layers.raster.functions.AspectFunctionArguments")],o);const n=o;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 e}from"tslib";import{property as t,subclass as s}from"../../../core/accessorSupport/decorators.js";import{isIntegerPixelType as i}from"../formats/pixelRangeUtils.js";import n from"./BandArithmeticFunctionArguments.js";import{calculateBandIndex as r,getBandMatrix3 as a}from"./bandIndexUtils.js";import o from"./BaseRasterFunction.js";const c=new Set(["vari","mtvi2","rtvi-core","evi"]);let u=class extends o{constructor(){super(...arguments),this.functionName="BandArithmetic",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){this.outputPixelType=this._getOutputPixelType("f32");const e=this.sourceRasterInfos[0];if(e.bandCount<2)return{success:!1,supportsGPU:!1,error:"band-arithmetic-function: source raster has insufficient amount of raster bands"};const t=e.clone();t.pixelType=this.outputPixelType,t.bandCount="sultan"===this.functionArguments.method?3:1,this._removeStatsHistColormapVAT(t),t.keyProperties={...t.keyProperties,BandProperties:void 0},this.rasterInfo=t;return{success:!0,supportsGPU:!["custom","gvitm","sultan"].includes(this.functionArguments.method)}}_processPixels(e){const t=e.pixelBlocks?.[0];if(null==t)return t;const{method:s,bandIndexes:i}=this.functionArguments,n=i.split(" ").map(e=>parseFloat(e));if(this.rasterInfo.storageInfo.isBsqTile){const{rawInputBandIds:e}=this,t=c.has(this.functionArguments.method)?3:2,s=n.slice(0,t).map(t=>e.indexOf(t-1));n.splice(0,t,...s)}return r(t,{method:s,bandIndexes:n,equation:i,outputPixelType:this.outputPixelType})}_getWebGLParameters(){const e=this.functionArguments.bandIndexes.split(" ").map(e=>parseFloat(e)-1);2===e.length&&e.push(0);const t=this.isInputBandIdsSwizzled?[0,1,2]:e;let s,n;const r=new Float32Array(3),{method:o}=this.functionArguments;switch(o){case"gndvi":case"nbr":case"ndbi":case"ndvi":case"ndvi-re":case"ndsi":case"ndmi":case"mndwi":s=a([t[0],t[1],0]),n="ndxi";break;case"ndwi":s=a([t[1],t[0],0]),n="ndxi";break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":s=a([t[0],t[1],0]),n="sr";break;case"ci-g":case"ci-re":s=a([t[0],t[1],0]),n="ci";break;case"savi":s=a([t[0],t[1],0]),n="savi",r[0]=e[2]+1;break;case"tsavi":s=a([t[0],t[1],0]),n="tsavi",r[0]=e[2]+1,r[1]=e[3]+1,r[2]=e[4]+1;break;case"msavi":s=a([t[0],t[1],0]),n="msavi";break;case"gemi":s=a([t[0],t[1],0]),n="gemi";break;case"pvi":s=a([t[0],t[1],0]),n="tsavi",r[0]=e[2]+1,r[1]=e[3]+1;break;case"vari":s=a([t[0],t[1],t[2]]),n="vari";break;case"mtvi2":s=a([t[0],t[1],t[2]]),n="mtvi";break;case"rtvi-core":s=a([t[0],t[1],t[2]]),n="rtvicore";break;case"evi":s=a([t[0],t[1],t[2]]),n="evi";break;case"wndwi":s=a([t[0],t[1],0]),n="wndwi",r[0]=e[3]?e[3]+1:.5;break;case"bai":s=a([t[1],t[0],0]),n="bai";break;default:s=a([0,1,2]),n="custom"}return{bandIndexMat3:s,indexType:n,adjustments:r,isOutputRounded:i(this.outputPixelType)}}_getInputBandIds(e){if("custom"===this.functionArguments.method)return e;const t=this.functionArguments.bandIndexes.split(" ").map(e=>parseFloat(e)-1),s=e.length,i=t.map(e=>e>=s?s-1:e),n=c.has(this.functionArguments.method)?3:2,r=i.slice(0,n).map(t=>e[t]);return 2===r.length&&r.push(0),r}_swizzleBandIds(e){const t=this.functionArguments.bandIndexes.split(" ").map(e=>parseFloat(e)-1);2===t.length&&t.push(0);const{method:s}=this.functionArguments,i=(["vari","mtvi2","rtvi-core","evi"].includes(s)?t.slice(0,3):"bai"===s||"ndwi"===s?[t[1],t[0]]:t.slice(0,2)).map(t=>e.indexOf(t));return i[2]??=i[1],this.isInputBandIdsSwizzled=!0,this.swizzledBandSelection=i,!1}};e([t({json:{write:!0,name:"rasterFunction"}})],u.prototype,"functionName",void 0),e([t({type:n,json:{write:!0,name:"rasterFunctionArguments"}})],u.prototype,"functionArguments",void 0),e([t()],u.prototype,"rasterArgumentNames",void 0),u=e([s("esri.layers.raster.functions.BandArithmeticFunction")],u);const m=u;export{m as default};
|
package/layers/{support/rasterFunctions → raster/functions}/BandArithmeticFunctionArguments.js
RENAMED
|
@@ -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 r}from"../../../core/lang.js";import{property as o,subclass as e}from"../../../core/accessorSupport/decorators.js";import{bandIndexMethodMap as s}from"./bandIndexUtils.js";import n from"./BaseFunctionArguments.js";import{enumeration as i}from"../../../core/accessorSupport/decorators/enumeration.js";var m;let a=m=class extends n{constructor(){super(...arguments),this.method="custom"}clone(){return new m({method:this.method,bandIndexes:this.bandIndexes,raster:r(this.raster)})}};t([o({json:{type:String,write:!0}})],a.prototype,"bandIndexes",void 0),t([i(s)],a.prototype,"method",void 0),a=m=t([e("esri.layers.
|
|
5
|
+
import{__decorate as t}from"tslib";import{clone as r}from"../../../core/lang.js";import{property as o,subclass as e}from"../../../core/accessorSupport/decorators.js";import{bandIndexMethodMap as s}from"./bandIndexUtils.js";import n from"./BaseFunctionArguments.js";import{enumeration as i}from"../../../core/accessorSupport/decorators/enumeration.js";var m;let a=m=class extends n{constructor(){super(...arguments),this.method="custom"}clone(){return new m({method:this.method,bandIndexes:this.bandIndexes,raster:r(this.raster)})}};t([o({json:{type:String,write:!0}})],a.prototype,"bandIndexes",void 0),t([i(s)],a.prototype,"method",void 0),a=m=t([e("esri.layers.raster.functions.BandArithmeticFunctionArguments")],a);const c=a;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 r}from"tslib";import{JSONSupport as o}from"../../../core/JSONSupport.js";import{property as t,subclass as s}from"../../../core/accessorSupport/decorators.js";let e=class extends o{constructor(){super(...arguments),this.raster=void 0}};r([t({json:{write:!0}})],e.prototype,"raster",void 0),e=r([s("esri.layers.
|
|
5
|
+
import{__decorate as r}from"tslib";import{JSONSupport as o}from"../../../core/JSONSupport.js";import{property as t,subclass as s}from"../../../core/accessorSupport/decorators.js";let e=class extends o{constructor(){super(...arguments),this.raster=void 0}};r([t({json:{write:!0}})],e.prototype,"raster",void 0),e=r([s("esri.layers.raster.functions.BaseFunctionArguments")],e);const c=e;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{JSONSupport as s}from"../../../core/JSONSupport.js";import{property as e,cast as r,subclass as n}from"../../../core/accessorSupport/decorators.js";import i from"../../support/PixelBlock.js";import o from"../../support/RasterInfo.js";const a=new Set(["slope","aspect","curvature","hillshade","shadedrelief","statistics"]);let u=class extends s{constructor(){super(...arguments),this.functionArguments=null,this.readingBufferSize=0,this.id=-1,this.isNoopProcess=!1,this.rawInputBandIds=[],this.rawSourceRasterInfos=null,this.isInputBandIdsSwizzled=!1,this.swizzledBandSelection=[],this.isBranch=!1,this.isRoot=!1,this._bindingResult=null}get supportsGPU(){return this._bindingResult.supportsGPU}get flatWebGLFunctionChain(){const t=this.getWebGLProcessorDefinition();if(!t)return null;const s=[t],{parameters:e}=t;let r=e.rasters||e.raster&&[e.raster];for(;r?.length;){s.unshift(...r);const t=[];for(let s=0;s<r.length;s++){const{parameters:e}=r[s],n=e.rasters||e.raster&&[e.raster];n?.length&&t.push(...n)}r=t}for(let a=s.length-1;a>=0;a--)s[a].isNoopProcess&&s.splice(a,1);let n=!1;for(let a=0;a<s.length;a++){const t=s[a];t.id=s.length-a-1;const{rasters:e}=t.parameters;n=n||null!=e&&e.length>1}const i=s.some(({name:t})=>a.has(t.toLowerCase())),{rawSourceRasterInfos:o}=this;return{functions:s,hasBranches:n,hasFocalFunction:i,isSourceSingleBand:1===o?.[0]?.bandCount}}bind(t,s=!1,e=-1){this.id=e+1;const r=this._getRasterValues();let n=!0;for(let i=0;i<r.length;i++){const e=r[i];if(null!=e&&this._isRasterFunctionValue(e)){const r=e.bind(t,s,this.id+i);if(!r.success)return this._bindingResult=r,r;n=n&&r.supportsGPU}}if(!this.rasterInfo||s){if(this.sourceRasterInfos=this._getSourceRasterInfos(t),this._bindingResult=this._bindSourceRasters(),n&&=this._bindingResult.supportsGPU,this._bindingResult.success&&(this._patchRasterInfo(),n&&this.isRoot)){this.processInputBandIds();this.swizzleInputBandIds(this.rawInputBandIds)||(n=this.rawInputBandIds.length<=3)}return this._bindingResult.supportsGPU=n,this._bindingResult}return this._bindingResult={success:!0,supportsGPU:!0},this._bindingResult}process(t){const s=this._getRasterValues(),e=0===s.length?t.pixelBlocks??t.primaryPixelBlocks:s.map(s=>this._readRasterValue(s,t));return this._processPixels({...t,pixelBlocks:e})}processInputBandIds(){const t=this._getRasterValues().filter(this._isRasterFunctionValue);if(t.length>1){const s=t.map(t=>t.processInputBandIds());return this.rawInputBandIds=[...new Set(s.flat())],this.rawInputBandIds}const s=t[0];if(s)return this.rawInputBandIds=s.processInputBandIds(),this.rawInputBandIds;const{bandCount:e}=this.sourceRasterInfos[0],r=Array.from({length:e},(t,s)=>s);return this.rawInputBandIds=this._getInputBandIds(r),this.rawInputBandIds}swizzleInputBandIds(t){const s=this._getRasterValues().filter(this._isRasterFunctionValue);let e=!0;for(const r of s)e=r.swizzleInputBandIds(t)&&e;return!!e&&this._swizzleBandIds(t)}getPrimaryRasters(){const t=[],s=[];return this._getPrimaryRasters(this,t,s),{rasters:t,rasterIds:s}}getWebGLProcessorDefinition(){const t=this._getWebGLParameters(),{raster:s,rasters:e}=this.functionArguments;return e&&Array.isArray(e)&&e.length?(t.rasters=e.map(t=>this._isRasterFunctionValue(t)?t.getWebGLProcessorDefinition():"number"==typeof t?{name:"Constant",parameters:{value:t},pixelType:"f32",id:-1,isNoopProcess:!1}:{name:"Identity",parameters:{value:t},pixelType:"f32",id:-1,isNoopProcess:!1}),t.rasters.some(t=>null!=t)||(t.rasters=null)):this._isRasterFunctionValue(s)&&(t.raster=s.getWebGLProcessorDefinition()),{name:this.functionName,parameters:t,pixelType:this.outputPixelType,id:this.id,isNoopProcess:this.isNoopProcess}}getClippingGeometries(){const t=[];"Clip"===this.functionName&&t.push(this.functionArguments);const{raster:s,rasters:e}=this.functionArguments;if(e&&Array.isArray(e)&&e.length)e.forEach(s=>{if(this._isRasterFunctionValue(s)){const e=s.getClippingGeometries();t.push(...e)}});else if(this._isRasterFunctionValue(s)){const e=s.getClippingGeometries();t.push(...e)}return t}_getOutputPixelType(t){return"unknown"===this.outputPixelType?t:this.outputPixelType??t}_getWebGLParameters(){return{}}_getInputBandIds(t){return t}_swizzleBandIds(t){return!0}_isInputRasterPrimaryOrConstant(){return!this._getRasterValues().some(t=>t&&"object"==typeof t&&"rasterFunction"in t&&t.rasterFunction)}_removeStatsHistColormapVAT(t){t.statistics=null,t.histograms=null,t.colormap=null,t.attributeTable=null,t.multidimensionalInfo?.variables.forEach(t=>{t.statistics=void 0,t.histograms=void 0})}_getRasterValues(){const{rasterArgumentNames:t}=this;return"rasters"===t[0]?this.functionArguments.rasters??[]:t.flatMap(t=>this.functionArguments[t])}_getSourceRasterInfos(t){const s=this._getRasterValues(),{rasterInfos:e,rasterIds:r}=t;if(0===s.length)return e;const n=s.map(t=>t&&"object"==typeof t&&"bind"in t&&t.rasterInfo?t.rasterInfo:"string"==typeof t&&r.includes(t)?e[r.indexOf(t)]:"number"!=typeof t?e[0]:void 0),i=n.find(t=>t)??e[0];return n.forEach((t,s)=>{void 0===t&&(n[s]=i)}),n}_getPrimaryRasterId(t){return t?.rasterId}_getPrimaryRasters(t,s=[],e=[]){for(let r=0;r<t.sourceRasters.length;r++){const n=t.sourceRasters[r];if("number"!=typeof n)if("bind"in n)this._getPrimaryRasters(n,s,e);else{const t=n,r=this._getPrimaryRasterId(t);if(null==r)continue;e.includes(r)||(this.mainPrimaryRasterId===r?(s.unshift(t),e.unshift(r)):(s.push(t),e.push(r)))}}}_isRasterFunctionValue(t){return null!=t&&"object"==typeof t&&"getWebGLProcessorDefinition"in t}_readRasterValue(t,s){const{primaryPixelBlocks:e}=s;if(null==t||"$$"===t){const t=e[0];return null==t?null:t.clone()}if("string"==typeof t){const r=s.primaryRasterIds.indexOf(t);return-1===r?null:e[r]}if("number"==typeof t){const s=e[0];if(null==s)return null;const{width:r,height:n,pixelType:o}=s,a=new Float32Array(r*n);a.fill(t);const u=this.sourceRasterInfos[0].bandCount,l=new Array(u).fill(a);return new i({width:r,height:n,pixelType:o,pixels:l})}return t.process(s)}_patchRasterInfo(){const{rasterInfo:t}=this;if(!t?.keyProperties)return;const{bandCount:s,keyProperties:e,statistics:r,histograms:n}=t,i=e.BandProperties;i&&i.length!==s&&(t.keyProperties={...e,BandProperties:void 0}),r&&r.length!==s&&(t.statistics=r.length>s?r.slice(0,s):null),n&&n.length!==s&&(t.histograms=n.length>s?n.slice(0,s):null),e.BAND_COUNT&&Number(e.BAND_COUNT)!==s&&(t.keyProperties={...e,BAND_COUNT:"string"==typeof e.BAND_COUNT?String(s):s})}};t([e({json:{write:!0}})],u.prototype,"functionName",void 0),t([e({json:{write:!0}})],u.prototype,"functionArguments",void 0),t([e()],u.prototype,"rasterArgumentNames",void 0),t([e({json:{write:!0}}),r(t=>t?.toLowerCase())],u.prototype,"outputPixelType",void 0),t([e({json:{write:!0}})],u.prototype,"mainPrimaryRasterId",void 0),t([e()],u.prototype,"sourceRasters",void 0),t([e({type:[o],json:{write:!0}})],u.prototype,"sourceRasterInfos",void 0),t([e({json:{write:!0}})],u.prototype,"rasterInfo",void 0),t([e({json:{write:!0}})],u.prototype,"readingBufferSize",void 0),t([e({json:{write:!0}})],u.prototype,"id",void 0),t([e()],u.prototype,"isNoopProcess",void 0),t([e()],u.prototype,"supportsGPU",null),t([e({json:{write:!0}})],u.prototype,"rawInputBandIds",void 0),t([e()],u.prototype,"rawSourceRasterInfos",void 0),t([e({json:{write:!0}})],u.prototype,"isInputBandIdsSwizzled",void 0),t([e({json:{write:!0}})],u.prototype,"swizzledBandSelection",void 0),t([e()],u.prototype,"isBranch",void 0),t([e()],u.prototype,"isRoot",void 0),t([e({readOnly:!0})],u.prototype,"flatWebGLFunctionChain",null),t([e()],u.prototype,"_bindingResult",void 0),u=t([n("esri.layers.raster.functions.BaseRasterFunction")],u);const l=u;export{l 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"./ClipFunctionArguments.js";import{clipRasterInfo as i}from"./clipUtils.js";import{projectExtent as n,projectPolygon as p}from"./rasterProjectionHelper.js";let c=class extends r{constructor(){super(...arguments),this.functionName="Clip",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone();this.outputPixelType=this._getOutputPixelType(t.pixelType),t.pixelType=this.outputPixelType,this.rasterInfo=t;const{functionArguments:e}=this,{clippingGeometry:s,clippingType:r}=e;if(!s)return{success:!1,supportsGPU:!1,error:"missing clipping geometry"};if("outside"===r)try{const{spatialReference:e}=t,r="extent"===s.type?n(s,e):p(s,e).extent;r&&i(t,r)}catch{}return{success:!0,supportsGPU:!0}}_processPixels(t){return t.pixelBlocks?.[0]}_getWebGLParameters(){const{clippingGeometry:t,clippingType:e}=this.functionArguments;return{clippingGeometry:t.toJSON(),clippingType:e}}};t([e({json:{write:!0,name:"rasterFunction"}})],c.prototype,"functionName",void 0),t([e({type:o,json:{write:!0,name:"rasterFunctionArguments"}})],c.prototype,"functionArguments",void 0),t([e()],c.prototype,"rasterArgumentNames",void 0),t([e()],c.prototype,"isNoopProcess",void 0),c=t([s("esri.layers.
|
|
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"./ClipFunctionArguments.js";import{clipRasterInfo as i}from"./clipUtils.js";import{projectExtent as n,projectPolygon as p}from"./rasterProjectionHelper.js";let c=class extends r{constructor(){super(...arguments),this.functionName="Clip",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone();this.outputPixelType=this._getOutputPixelType(t.pixelType),t.pixelType=this.outputPixelType,this.rasterInfo=t;const{functionArguments:e}=this,{clippingGeometry:s,clippingType:r}=e;if(!s)return{success:!1,supportsGPU:!1,error:"missing clipping geometry"};if("outside"===r)try{const{spatialReference:e}=t,r="extent"===s.type?n(s,e):p(s,e).extent;r&&i(t,r)}catch{}return{success:!0,supportsGPU:!0}}_processPixels(t){return t.pixelBlocks?.[0]}_getWebGLParameters(){const{clippingGeometry:t,clippingType:e}=this.functionArguments;return{clippingGeometry:t.toJSON(),clippingType:e}}};t([e({json:{write:!0,name:"rasterFunction"}})],c.prototype,"functionName",void 0),t([e({type:o,json:{write:!0,name:"rasterFunctionArguments"}})],c.prototype,"functionArguments",void 0),t([e()],c.prototype,"rasterArgumentNames",void 0),t([e()],c.prototype,"isNoopProcess",void 0),c=t([s("esri.layers.raster.functions.ClipFunction")],c);const u=c;export{u 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{fromJSON as
|
|
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{fromJSON as i}from"../../../geometry/support/jsonUtils.js";import{geometryTypes as s}from"../../../geometry/support/typeUtils.js";import p from"./BaseFunctionArguments.js";var n;const c=new o({1:"outside",2:"inside"},{useNumericKeys:!0});let m=n=class extends p{constructor(){super(...arguments),this.clippingType="outside"}clone(){return new n({clippingGeometry:this.clippingGeometry.clone(),clippingType:this.clippingType})}};e([r({types:s,json:{read:i,write:!0}})],m.prototype,"clippingGeometry",void 0),e([r({json:{read:c.read,write:c.write}})],m.prototype,"clippingType",void 0),m=n=e([t("esri.layers.raster.functions.ClipFunctionArguments")],m);const l=m;export{l 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 o}from"tslib";import{property as t,subclass as r}from"../../../core/accessorSupport/decorators.js";import{isIntegerPixelType as s}from"../formats/pixelRangeUtils.js";import e from"./BaseRasterFunction.js";import p from"./ColormapFunctionArguments.js";import{getColormapByName as i}from"./colormaps.js";import{convertColorRampToColormap as n,getColorRampJSON as a}from"../../../renderers/support/colorRampUtils.js";import{fromJSON as c}from"../../../rest/support/colorRamps.js";let m=class extends e{constructor(){super(...arguments),this.functionName="Colormap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const o=this.sourceRasterInfos[0];if(o.bandCount>1)return{success:!1,supportsGPU:!1,error:"colormap-function: source data must be single band"};let{colormap:t,colormapName:r,colorRamp:s,colorRampName:e}=this.functionArguments;if(!t?.length)if(s)this.colorRamp=s,t=n(s,{interpolateAlpha:!0});else if(e){const o=a(e);o&&(t=n(o),this.colorRamp=c(o))}else r&&(t=i(r));if(!t?.length)return{success:!1,supportsGPU:!1,error:"colormap-function: missing colormap argument"};const p=this._getOutputPixelType(o.pixelType);this.outputPixelType=p.startsWith("f")?"s32":p;const m=o.clone();return m.pixelType=this.outputPixelType,m.colormap=t,m.bandCount=1,this.rasterInfo=m,{success:!0,supportsGPU:!0}}_processPixels(o){let t=o.pixelBlocks?.[0];return!t||s(t.pixelType)||(t=t.clone(),t.clamp(this.outputPixelType)),t}};o([t({json:{write:!0,name:"rasterFunction"}})],m.prototype,"functionName",void 0),o([t({type:p,json:{write:!0,name:"rasterFunctionArguments"}})],m.prototype,"functionArguments",void 0),o([t()],m.prototype,"rasterArgumentNames",void 0),o([t()],m.prototype,"isNoopProcess",void 0),o([t({json:{write:!0}})],m.prototype,"indexedColormap",void 0),o([t()],m.prototype,"colorRamp",void 0),m=o([r("esri.layers.raster.functions.ColormapFunction")],m);const u=m;export{u 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{clone as r}from"../../../core/lang.js";import{property as e,cast as t,subclass as a}from"../../../core/accessorSupport/decorators.js";import p from"./BaseFunctionArguments.js";import{colorRampDict as m,rasterColormapNames as s}from"../../../renderers/support/colorRampUtils.js";import{types as l,fromJSON as n}from"../../../rest/support/colorRamps.js";import{reader as c}from"../../../core/accessorSupport/decorators/reader.js";var i;let u=i=class extends p{castColormapName(o){if(!o)return null;const r=o.toLowerCase();return s.includes(r)?r:null}readColorRamp(o){return n(o)}readColorRampName(o,r){if(!o)return null;const e=m.jsonValues.find(r=>r.toLowerCase()===o.toLowerCase());return e?m.fromJSON(e):null}clone(){return new i({colormap:r(this.colormap),colormapName:this.colormapName,colorRamp:this.colorRamp?.clone(),colorRampName:this.colorRampName})}};o([e({type:[[Number]],json:{write:!0}})],u.prototype,"colormap",void 0),o([e({type:String,json:{write:!0}})],u.prototype,"colormapName",void 0),o([t("colormapName")],u.prototype,"castColormapName",null),o([e({types:l,json:{write:!0}})],u.prototype,"colorRamp",void 0),o([c("colorRamp")],u.prototype,"readColorRamp",null),o([e({type:m.apiValues,json:{type:m.jsonValues,write:m.write}})],u.prototype,"colorRampName",void 0),o([c("colorRampName")],u.prototype,"readColorRampName",null),u=i=o([a("esri.layers.
|
|
5
|
+
import{__decorate as o}from"tslib";import{clone as r}from"../../../core/lang.js";import{property as e,cast as t,subclass as a}from"../../../core/accessorSupport/decorators.js";import p from"./BaseFunctionArguments.js";import{colorRampDict as m,rasterColormapNames as s}from"../../../renderers/support/colorRampUtils.js";import{types as l,fromJSON as n}from"../../../rest/support/colorRamps.js";import{reader as c}from"../../../core/accessorSupport/decorators/reader.js";var i;let u=i=class extends p{castColormapName(o){if(!o)return null;const r=o.toLowerCase();return s.includes(r)?r:null}readColorRamp(o){return n(o)}readColorRampName(o,r){if(!o)return null;const e=m.jsonValues.find(r=>r.toLowerCase()===o.toLowerCase());return e?m.fromJSON(e):null}clone(){return new i({colormap:r(this.colormap),colormapName:this.colormapName,colorRamp:this.colorRamp?.clone(),colorRampName:this.colorRampName})}};o([e({type:[[Number]],json:{write:!0}})],u.prototype,"colormap",void 0),o([e({type:String,json:{write:!0}})],u.prototype,"colormapName",void 0),o([t("colormapName")],u.prototype,"castColormapName",null),o([e({types:l,json:{write:!0}})],u.prototype,"colorRamp",void 0),o([c("colorRamp")],u.prototype,"readColorRamp",null),o([e({type:m.apiValues,json:{type:m.jsonValues,write:m.write}})],u.prototype,"colorRampName",void 0),o([c("colorRampName")],u.prototype,"readColorRampName",null),u=i=o([a("esri.layers.raster.functions.ColormapFunctionArguments")],u);const d=u;export{d 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 o,subclass as e}from"../../../core/accessorSupport/decorators.js";import r from"./BaseRasterFunction.js";import s from"./ColormapToRGBFunctionArguments.js";import{createColormapLUT as n}from"./pixelUtils.js";import{SimpleBandStatistics as i}from"../../support/SimpleBandStatistics.js";import{isColormapSupportedByWebGL as p}from"../../../renderers/support/rasterRendererChecks.js";let a=class extends r{constructor(){super(...arguments),this.functionName="ColormapToRGB",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1||!t.colormap?.length)return{success:!1,supportsGPU:!1,error:"colormap-to-rgb-function: source data must be single band with a colormap"};const o=t.clone();o.pixelType=this.outputPixelType=this._getOutputPixelType("u8"),this._removeStatsHistColormapVAT(o),o.bandCount=3,o.statistics=[{min:0,max:255,avg:100,stddev:20},{min:0,max:255,avg:100,stddev:20},{min:0,max:255,avg:100,stddev:20}],this.rasterInfo=o;const e=[...t.colormap].sort((t,o)=>t[0]-o[0]),{indexedColormap:r,offset:s}=n({colormap:e});return r?(this.lookup={indexedColormap:r,offset:s},{success:!0,supportsGPU:p(r)}):{success:!1,supportsGPU:!1,error:"colormap-to-rgb-function: the colormap is not supported"}}_processPixels(t){let o=t.pixelBlocks?.[0];if(!o||!this.lookup)return o;o=o.clone();const e=o.pixels[0],r=o.mask??new Uint8Array(e.length).fill(255),s=new Uint8Array(e.length),n=new Uint8Array(e.length),p=new Uint8Array(e.length),{indexedColormap:a,offset:u}=this.lookup,l=a.length;for(let i=0;i<e.length;i++)if(r[i]){let t=4*(e[i]-u);t<0||t>l-4?r[i]=0:(s[i]=a[t++],n[i]=a[t++],p[i]=a[t++])}return o.pixels=[s,n,p],o.statistics=[new i(0,255),new i(0,255),new i(0,255)],o.pixelType=this.outputPixelType,o}_getWebGLParameters(){return this.lookup}};t([o({json:{write:!0,name:"rasterFunction"}})],a.prototype,"functionName",void 0),t([o({type:s,json:{write:!0,name:"rasterFunctionArguments"}})],a.prototype,"functionArguments",void 0),t([o()],a.prototype,"rasterArgumentNames",void 0),t([o({json:{write:!0}})],a.prototype,"lookup",void 0),a=t([e("esri.layers.raster.functions.ColormapToRGBFunction")],a);const u=a;export{u as default};
|
package/layers/{support/rasterFunctions → raster/functions}/ColormapToRGBFunctionArguments.js
RENAMED
|
@@ -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 s}from"../../../core/accessorSupport/decorators.js";import t from"./BaseFunctionArguments.js";var o;let e=o=class extends t{clone(){return new o({raster:this.raster})}};e=o=r([s("esri.layers.
|
|
5
|
+
import{__decorate as r}from"tslib";import{subclass as s}from"../../../core/accessorSupport/decorators.js";import t from"./BaseFunctionArguments.js";var o;let e=o=class extends t{clone(){return new o({raster:this.raster})}};e=o=r([s("esri.layers.raster.functions.ColormapToRGBFunctionArguments")],e);const n=e;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 e,subclass as s}from"../../../core/accessorSupport/decorators.js";import n from"./BaseRasterFunction.js";import r from"./CompositeBandFunctionArguments.js";import{compositeBands as o}from"./pixelUtils.js";let i=class extends n{constructor(){super(...arguments),this.functionName="CompositeBand",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:t}=this,e=t[0];this.outputPixelType=this._getOutputPixelType(e.pixelType);const s=e.clone();if(s.attributeTable=null,s.colormap=null,s.pixelType=this.outputPixelType,s.bandCount=t.map(({bandCount:t})=>t).reduce((t,e)=>t+e),t.every(({statistics:t})=>null!=t&&t.length)){const e=[];t.forEach(({statistics:t})=>null!=t&&e.push(...t)),s.statistics=e}if(t.every(({histograms:t})=>null!=t&&t.length)){const e=[];t.forEach(({histograms:t})=>null!=t&&e.push(...t)),s.histograms=e}s.multidimensionalInfo&&s.multidimensionalInfo.variables.forEach(e=>{const s=t.map(t=>t.multidimensionalInfo?.variables.find(({name:t})=>t===e.name)),n=s.map(t=>t?.statistics?.length?t.statistics:null),r=s.map(t=>t?.histograms?.length?t.histograms:null);e.statistics=n.every(t=>null!=t)?n.flat():null,e.histograms=r.every(t=>null!=t)?r.flat():null}),s.bandCount>1&&(s.colormap=null,s.attributeTable=null);const n=t.every(t=>t.keyProperties.BandProperties?.length)?t.flatMap(t=>t.keyProperties.BandProperties):void 0;s.keyProperties={...s.keyProperties,BandProperties:n},this.rasterInfo=s;return{success:!0,supportsGPU:s.bandCount<=3}}_processPixels(t){const{pixelBlocks:e}=t;if(!e)return null;const s=e?.[0];return null==s?null:o(e)}_getWebGLParameters(){return{bandCount:this.rasterInfo.bandCount}}};t([e({json:{write:!0,name:"rasterFunction"}})],i.prototype,"functionName",void 0),t([e({type:r,json:{write:!0,name:"rasterFunctionArguments"}})],i.prototype,"functionArguments",void 0),t([e()],i.prototype,"rasterArgumentNames",void 0),i=t([s("esri.layers.raster.functions.CompositeBandFunction")],i);const a=i;export{a 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 r}from"tslib";import{clone as t}from"../../../core/lang.js";import{property as s,subclass as e}from"../../../core/accessorSupport/decorators.js";import o from"./BaseFunctionArguments.js";import{writer as a}from"../../../core/accessorSupport/decorators/writer.js";var n;let i=n=class extends o{constructor(){super(...arguments),this.rasters=[]}writeRasters(r,t){t.rasters=r.map(r=>"number"==typeof r||"string"==typeof r?r:r.toJSON())}clone(){return new n({rasters:t(this.rasters)})}};r([s({json:{write:!0}})],i.prototype,"rasters",void 0),r([a("rasters")],i.prototype,"writeRasters",null),i=n=r([e("esri.layers.raster.functions.CompositeBandFunctionArguments")],i);const p=i;export{p 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{getPixelValueRange as n,isIntegerPixelType as r}from"../formats/pixelRangeUtils.js";import a from"./BaseRasterFunction.js";import{computeChange as o}from"./changeDetectionUtils.js";import i from"./ComputeChangeFunctionArguments.js";import u from"../../support/Field.js";let l=class extends a{constructor(){super(...arguments),this.functionName="ComputeChange",this.functionArguments=null,this.rasterArgumentNames=["raster","raster2"]}_bindSourceRasters(){const{method:e}=this.functionArguments,t=this.sourceRasterInfos[0].clone();if(this.outputPixelType=this._getOutputPixelType(t.pixelType),t.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(t),"categorical"===e){const e=this.sourceRasterInfos.map(e=>e.attributeTable),s=this._getFieldNames(e,"value"),n=e.map(e=>this._getClassFieldName(e));if(null==s[0]||null==s[1]||null==n[0]||null==n[1])return{success:!1,supportsGPU:!1,error:"both inputs must have proper attribute table with value and class fields"};this._updateAttributeTable(t,s,n)}t.bandCount=1,this.rasterInfo=t;return{success:!0,supportsGPU:"difference"===e||"relative-difference"===e}}_processPixels(e){const{pixelBlocks:t}=e;if(null==t?.[0]||null==t?.[1])return null;const{method:s}=this.functionArguments;return o(t,s,this.outputPixelType,this._categoryConfig)}_getWebGLParameters(){const e=this.outputPixelType??"f32";let[t,s]=n(e);const a=r(e);return a&&(t-=1e-4,s+=1e-4),{method:this.functionArguments.method,domainRange:[t,s],isOutputRounded:a}}_updateAttributeTable(e,t,s){const n=this.sourceRasterInfos.map(e=>e.attributeTable),r=n.map((e,s)=>e.features.map(e=>e.attributes[t[s]])),a=n.map((e,t)=>e.features.map(e=>e.attributes[s[t]])),o=r.map(e=>{const t=[];return e.forEach((e,s)=>t[e]=s),t}),{keepMethod:i}=this.functionArguments;this._categoryConfig={categoryIndexLookups:o,classNames:a,keepMethod:i};const l=n[0].clone();l.fields=[new u({name:"OID",type:"oid"}),new u({name:"Value",type:"integer"}),new u({name:"ClassName",type:"string"}),new u({name:"Class_From",type:"string"}),new u({name:"Class_To",type:"string"})];const m=this._getFieldNames(n,"red"),p=this._getFieldNames(n,"green"),c=this._getFieldNames(n,"blue"),f=[],d=2===m.length&&2===p.length&&2===c.length;d&&(f.push(...n.map((e,t)=>e.features.map(e=>[e.attributes[m[t]],e.attributes[p[t]],e.attributes[c[t]]]))),l.fields.push(new u({name:"Red",type:"integer"}),new u({name:"Green",type:"integer"}),new u({name:"Blue",type:"integer"})));const g=l.features[0].clone();g.geometry=null;const h=[],[y,C]=r.map(e=>e.length);let b=1;for(let u=0;u<y;u++){const e=a[0][u];for(let t=0;t<C;t++){const s=a[1][t];if("changed"===i&&e===s||"unchanged"===i&&e!==s)continue;const n=g.clone();n.attributes={OID:b++,Value:u*C+t,ClassName:e===s?e:`${e} -> ${s}`,Class_From:e,Class_To:s},d&&(n.attributes.Red=f[0][u][0]+f[1][t][0]>>1,n.attributes.Green=f[0][u][1]+f[1][t][1]>>1,n.attributes.Blue=f[0][u][2]+f[1][t][2]>>1),h.push(n)}}if("changed"===i){const e=g.clone();e.attributes={OID:b++,Value:y*C+1,ClassName:"No Change",Class_From:"Same",Class_To:"Same"},h.push(e)}else if("unchanged"===i){const e=g.clone();e.attributes={OID:b++,Value:y*C+2,ClassName:"Changed",Class_From:"Any",Class_To:"Any"},h.push(e)}l.features=h,e.attributeTable=l}_getFieldNames(e,t){return e.map(({fields:e})=>e.find(e=>e.name.toLowerCase()===t)?.name).filter(e=>e)}_getClassFieldName(e){const t=e.fields.find(e=>"string"===e.type&&e.name.toLowerCase().startsWith("class"))??e.fields.find(e=>"string"===e.type&&e.name.toLowerCase().includes("class")||e.name.toLowerCase().includes("type")||e.name.toLowerCase().includes("name"))??e.fields.find(e=>"string"===e.type);return t?.name}};e([t({json:{write:!0,name:"rasterFunction"}})],l.prototype,"functionName",void 0),e([t({type:i,json:{write:!0,name:"rasterFunctionArguments"}})],l.prototype,"functionArguments",void 0),e([t()],l.prototype,"rasterArgumentNames",void 0),e([t({json:{write:!0}})],l.prototype,"_categoryConfig",void 0),l=e([s("esri.layers.raster.functions.ComputeChangeFunction")],l);const m=l;export{m as default};
|
package/layers/{support/rasterFunctions → raster/functions}/ComputeChangeFunctionArguments.js
RENAMED
|
@@ -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 r}from"../../../core/accessorSupport/decorators.js";import o from"./BaseFunctionArguments.js";import{changeMethodMap as s,keepMethodMap as i}from"./changeDetectionUtils.js";import{enumeration as a}from"../../../core/accessorSupport/decorators/enumeration.js";var
|
|
5
|
+
import{__decorate as t}from"tslib";import{property as e,subclass as r}from"../../../core/accessorSupport/decorators.js";import o from"./BaseFunctionArguments.js";import{changeMethodMap as s,keepMethodMap as i}from"./changeDetectionUtils.js";import{enumeration as a}from"../../../core/accessorSupport/decorators/enumeration.js";var n;let p=n=class extends o{constructor(){super(...arguments),this.method="difference",this.keepMethod="all",this.raster2=void 0}get rasters(){return[this.raster,this.raster2]}clone(){return new n({raster:this.raster,raster2:this.raster2,method:this.method,keepMethod:this.keepMethod})}};t([a(s)],p.prototype,"method",void 0),t([a(i)],p.prototype,"keepMethod",void 0),t([e({json:{write:!0}})],p.prototype,"raster2",void 0),t([e({readOnly:!0})],p.prototype,"rasters",null),p=n=t([r("esri.layers.raster.functions.ComputeChangeFunctionArguments")],p);const c=p;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 s,subclass as r}from"../../../core/accessorSupport/decorators.js";import e from"./BaseRasterFunction.js";import o from"./ContrastBrightnessFunctionArguments.js";import{lookupPixels as n}from"./pixelUtils.js";import{createContrastBrightnessLUT as i}from"./stretchUtils.js";let u=class extends e{constructor(){super(...arguments),this.functionName="ContrastBrightness",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){const{sourceRasterInfos:t}=this,s=t[0];if("u8"!==s.pixelType)return{success:!1,supportsGPU:!1,error:"Only unsigned 8 bit raster is supported by ContrastBrightness function."};this.outputPixelType=this._getOutputPixelType("u8");const r=s.clone();this._removeStatsHistColormapVAT(r),this.rasterInfo=r;const{contrastOffset:e,brightnessOffset:o}=this.functionArguments;return this.lookup=i(e,o),{success:!0,supportsGPU:!0}}_processPixels(t){const s=t.pixelBlocks?.[0];return null==s?null:n(s,{lut:s.pixels.map(()=>this.lookup),offset:0,outputPixelType:"u8"})}_getWebGLParameters(){const{contrastOffset:t,brightnessOffset:s}=this.functionArguments;return{contrastOffset:t,brightnessOffset:s}}};t([s({json:{write:!0,name:"rasterFunction"}})],u.prototype,"functionName",void 0),t([s({type:o,json:{write:!0,name:"rasterFunctionArguments"}})],u.prototype,"functionArguments",void 0),t([s()],u.prototype,"rasterArgumentNames",void 0),t([s({json:{write:!0}})],u.prototype,"lookup",void 0),u=t([r("esri.layers.
|
|
5
|
+
import{__decorate as t}from"tslib";import{property as s,subclass as r}from"../../../core/accessorSupport/decorators.js";import e from"./BaseRasterFunction.js";import o from"./ContrastBrightnessFunctionArguments.js";import{lookupPixels as n}from"./pixelUtils.js";import{createContrastBrightnessLUT as i}from"./stretchUtils.js";let u=class extends e{constructor(){super(...arguments),this.functionName="ContrastBrightness",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){const{sourceRasterInfos:t}=this,s=t[0];if("u8"!==s.pixelType)return{success:!1,supportsGPU:!1,error:"Only unsigned 8 bit raster is supported by ContrastBrightness function."};this.outputPixelType=this._getOutputPixelType("u8");const r=s.clone();this._removeStatsHistColormapVAT(r),this.rasterInfo=r;const{contrastOffset:e,brightnessOffset:o}=this.functionArguments;return this.lookup=i(e,o),{success:!0,supportsGPU:!0}}_processPixels(t){const s=t.pixelBlocks?.[0];return null==s?null:n(s,{lut:s.pixels.map(()=>this.lookup),offset:0,outputPixelType:"u8"})}_getWebGLParameters(){const{contrastOffset:t,brightnessOffset:s}=this.functionArguments;return{contrastOffset:t,brightnessOffset:s}}};t([s({json:{write:!0,name:"rasterFunction"}})],u.prototype,"functionName",void 0),t([s({type:o,json:{write:!0,name:"rasterFunctionArguments"}})],u.prototype,"functionArguments",void 0),t([s()],u.prototype,"rasterArgumentNames",void 0),t([s({json:{write:!0}})],u.prototype,"lookup",void 0),u=t([r("esri.layers.raster.functions.ContrastBrightnessFunction")],u);const p=u;export{p as default};
|
package/layers/{support/rasterFunctions → raster/functions}/ContrastBrightnessFunctionArguments.js
RENAMED
|
@@ -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 r}from"../../../core/accessorSupport/decorators.js";import e from"./BaseFunctionArguments.js";var o;let n=o=class extends e{constructor(){super(...arguments),this.contrastOffset=0,this.brightnessOffset=0}clone(){return new o({contrastOffset:this.contrastOffset,brightnessOffset:this.brightnessOffset,raster:this.raster})}};t([s({json:{write:!0}})],n.prototype,"contrastOffset",void 0),t([s({json:{write:!0}})],n.prototype,"brightnessOffset",void 0),n=o=t([r("esri.layers.
|
|
5
|
+
import{__decorate as t}from"tslib";import{property as s,subclass as r}from"../../../core/accessorSupport/decorators.js";import e from"./BaseFunctionArguments.js";var o;let n=o=class extends e{constructor(){super(...arguments),this.contrastOffset=0,this.brightnessOffset=0}clone(){return new o({contrastOffset:this.contrastOffset,brightnessOffset:this.brightnessOffset,raster:this.raster})}};t([s({json:{write:!0}})],n.prototype,"contrastOffset",void 0),t([s({json:{write:!0}})],n.prototype,"brightnessOffset",void 0),n=o=t([r("esri.layers.raster.functions.ContrastBrightnessFunctionArguments")],n);const i=n;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 t}from"tslib";import{property as e,subclass as o}from"../../../core/accessorSupport/decorators.js";import{getPixelValueRange as n}from"../formats/pixelRangeUtils.js";import s from"./BaseRasterFunction.js";import r from"./ConvolutionFunctionArguments.js";import{convolute as i}from"./convolutionUtils.js";import{convolutionKernel as u}from"../../support/rasterFunctionConstants.js";const l=25;let c=class extends s{constructor(){super(...arguments),this.functionName="Convolution",this.rasterArgumentNames=["raster"]}get _normalizedKernel(){const{kernel:t,convolutionType:e}=this.functionArguments,o=t.reduce((t,e)=>t+e);return-1===e||0===o||1===o?t:t.map(t=>t/o)}_bindSourceRasters(){const{convolutionType:t,rows:e,cols:o,kernel:n}=this.functionArguments;if(!Object.values(u).includes(t))return{success:!1,supportsGPU:!1,error:`convolution-function: the specified kernel type is not supported ${t}`};if(t!==u.none&&e*o!==n.length)return{success:!1,supportsGPU:!1,error:"convolution-function: the specified rows and cols do not match the length of the kernel"};const s=this.sourceRasterInfos[0];this.outputPixelType=this._getOutputPixelType(s.pixelType);const r=s.clone();r.pixelType=this.outputPixelType;const i=[u.none,u.sharpen,u.sharpen2,u.sharpening3x3,u.sharpening5x5];(-1===t||"u8"!==this.outputPixelType&&!i.includes(t))&&(r.statistics=null,r.histograms=null),r.colormap=null,r.attributeTable=null,this.rasterInfo=r;return{success:!0,supportsGPU:n.length<=l}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e||this.functionArguments.convolutionType===u.none)return e;const{rows:o,cols:n}=this.functionArguments,{_normalizedKernel:s}=this;return i(e,{kernel:s,rows:o,cols:n,outputPixelType:this.outputPixelType})}_getWebGLParameters(){const t=new Float32Array(l),{rows:e,cols:o}=this.functionArguments,{_normalizedKernel:s}=this;for(let n=0;n<e;n++)for(let e=0;e<o;e++)t[5*n+e]=s[n*o+e];return{kernelRows:e,kernelCols:o,kernel:t,clampRange:n(this.outputPixelType)}}};t([e({json:{write:!0,name:"rasterFunction"}})],c.prototype,"functionName",void 0),t([e({type:r,json:{write:!0,name:"rasterFunctionArguments"}})],c.prototype,"functionArguments",void 0),t([e()],c.prototype,"rasterArgumentNames",void 0),t([e()],c.prototype,"_normalizedKernel",null),c=t([o("esri.layers.raster.functions.ConvolutionFunction")],c);const p=c;export{p 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{clone as o}from"../../../core/lang.js";import{property as e,subclass as s}from"../../../core/accessorSupport/decorators.js";import r from"./BaseFunctionArguments.js";import{convolutionKernels as n}from"./convolutionUtils.js";import{convolutionKernel as i}from"../../support/rasterFunctionConstants.js";var p;let l=p=class extends r{constructor(){super(...arguments),this.rows=3,this.cols=3,this.kernel=[0,0,0,0,1,0,0,0,0]}set convolutionType(t){this._set("convolutionType",t);const o=n.get(t);if(!o||t===i.userDefined||t===i.none)return;const e=Math.sqrt(o.length);this._set("kernel",o),this._set("cols",e),this._set("rows",e)}clone(){return new p({cols:this.cols,rows:this.rows,kernel:[...this.kernel],convolutionType:this.convolutionType,raster:o(this.raster)})}};t([e({json:{type:Number,write:!0}})],l.prototype,"rows",void 0),t([e({json:{type:Number,write:!0}})],l.prototype,"cols",void 0),t([e({json:{name:"type",type:Number,write:!0}})],l.prototype,"convolutionType",null),t([e({json:{type:[Number],write:!0}})],l.prototype,"kernel",void 0),l=p=t([s("esri.layers.raster.functions.ConvolutionFunctionArguments")],l);const c=l;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 r}from"../../../core/accessorSupport/decorators.js";import s from"./BaseRasterFunction.js";import o from"./CurvatureFunctionArguments.js";import{gcsFactor as i,curvature as n}from"./surfaceUtils.js";let u=class extends s{constructor(){super(...arguments),this.functionName="Curvature",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,t.bandCount=1,this._removeStatsHistColormapVAT(t),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:r,curvatureType:s}=this.functionArguments,{extent:o,primaryPixelSizes:u}=t,a=u?.[0],c=a??(o?{x:o.width/e.width,y:o.height/e.height}:{x:1,y:1}),p=this.isGCS&&r>=1?r*i:r;return n(e,{zFactor:p,curvatureType:s,resolution:c})}_getWebGLParameters(){const{zFactor:t,curvatureType:e}=this.functionArguments;return{curvatureType:e,zFactor:this.isGCS&&t>=1?t*i:t}}};t([e({json:{write:!0,name:"rasterFunction"}})],u.prototype,"functionName",void 0),t([e({type:o,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([r("esri.layers.
|
|
5
|
+
import{__decorate as t}from"tslib";import{property as e,subclass as r}from"../../../core/accessorSupport/decorators.js";import s from"./BaseRasterFunction.js";import o from"./CurvatureFunctionArguments.js";import{gcsFactor as i,curvature as n}from"./surfaceUtils.js";let u=class extends s{constructor(){super(...arguments),this.functionName="Curvature",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,t.bandCount=1,this._removeStatsHistColormapVAT(t),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:r,curvatureType:s}=this.functionArguments,{extent:o,primaryPixelSizes:u}=t,a=u?.[0],c=a??(o?{x:o.width/e.width,y:o.height/e.height}:{x:1,y:1}),p=this.isGCS&&r>=1?r*i:r;return n(e,{zFactor:p,curvatureType:s,resolution:c})}_getWebGLParameters(){const{zFactor:t,curvatureType:e}=this.functionArguments;return{curvatureType:e,zFactor:this.isGCS&&t>=1?t*i:t}}};t([e({json:{write:!0,name:"rasterFunction"}})],u.prototype,"functionName",void 0),t([e({type:o,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([r("esri.layers.raster.functions.CurvatureFunction")],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 r}from"tslib";import{JSONMap as e}from"../../../core/jsonMap.js";import{property as t,subclass as o}from"../../../core/accessorSupport/decorators.js";import s from"./BaseFunctionArguments.js";import{enumeration as a}from"../../../core/accessorSupport/decorators/enumeration.js";import{reader as u}from"../../../core/accessorSupport/decorators/reader.js";var p;const c=new e({0:"standard",1:"planform",2:"profile"},{useNumericKeys:!0});let n=p=class extends s{constructor(){super(...arguments),this.curvatureType="standard",this.zFactor=1}readCurvatureType(r,e){return c.fromJSON(e.type??e.curvatureType??0)}clone(){return new p({curvatureType:this.curvatureType,zFactor:this.zFactor,raster:this.raster})}};r([t({json:{write:{target:"type"}}}),a(c)],n.prototype,"curvatureType",void 0),r([u("curvatureType",["type","curvatureType"])],n.prototype,"readCurvatureType",null),r([t({type:Number,json:{write:!0}})],n.prototype,"zFactor",void 0),n=p=r([o("esri.layers.
|
|
5
|
+
import{__decorate as r}from"tslib";import{JSONMap as e}from"../../../core/jsonMap.js";import{property as t,subclass as o}from"../../../core/accessorSupport/decorators.js";import s from"./BaseFunctionArguments.js";import{enumeration as a}from"../../../core/accessorSupport/decorators/enumeration.js";import{reader as u}from"../../../core/accessorSupport/decorators/reader.js";var p;const c=new e({0:"standard",1:"planform",2:"profile"},{useNumericKeys:!0});let n=p=class extends s{constructor(){super(...arguments),this.curvatureType="standard",this.zFactor=1}readCurvatureType(r,e){return c.fromJSON(e.type??e.curvatureType??0)}clone(){return new p({curvatureType:this.curvatureType,zFactor:this.zFactor,raster:this.raster})}};r([t({json:{write:{target:"type"}}}),a(c)],n.prototype,"curvatureType",void 0),r([u("curvatureType",["type","curvatureType"])],n.prototype,"readCurvatureType",null),r([t({type:Number,json:{write:!0}})],n.prototype,"zFactor",void 0),n=p=r([o("esri.layers.raster.functions.CurvatureFunctionArguments")],n);const i=n;export{i 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 n,subclass as e}from"../../../core/accessorSupport/decorators.js";import{getBandMatrix3 as s}from"./bandIndexUtils.js";import r from"./BaseRasterFunction.js";import i from"./ExtractBandFunctionArguments.js";let a=class extends r{constructor(){super(...arguments),this.functionName="ExtractBand",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{functionArguments:t,sourceRasterInfos:n}=this,e=n[0],{method:s,bandNames:r,bandWavelengths:i,bandIds:a,missingBandAction:o}=t,h=r?.length&&("name"===s||"id"!==s&&!a?.length),c=i?.length&&("wavelength"===s||"id"!==s&&!a?.length),m=1===o,g=h?l(e,r):c?d(e,i,this.functionArguments,m):u(e,a,m);if(null==g){return{success:!1,supportsGPU:!1,error:`extract-band-function: Invalid ${h?"band names":c?"band wavelengths":"band ids"} for the imagery data source`}}this.functionArguments.bandIds=g,this.functionArguments.method="id",this.outputPixelType=this._getOutputPixelType("f32");const
|
|
5
|
+
import{__decorate as t}from"tslib";import{property as n,subclass as e}from"../../../core/accessorSupport/decorators.js";import{getBandMatrix3 as s}from"./bandIndexUtils.js";import r from"./BaseRasterFunction.js";import i from"./ExtractBandFunctionArguments.js";let a=class extends r{constructor(){super(...arguments),this.functionName="ExtractBand",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{functionArguments:t,sourceRasterInfos:n}=this,e=n[0],{method:s,bandNames:r,bandWavelengths:i,bandIds:a,missingBandAction:o}=t,h=r?.length&&("name"===s||"id"!==s&&!a?.length),c=i?.length&&("wavelength"===s||"id"!==s&&!a?.length),m=1===o,g=h?l(e,r):c?d(e,i,this.functionArguments,m):u(e,a,m);if(null==g){return{success:!1,supportsGPU:!1,error:`extract-band-function: Invalid ${h?"band names":c?"band wavelengths":"band ids"} for the imagery data source`}}this.functionArguments.bandIds=g,this.functionArguments.method="id",this.outputPixelType=this._getOutputPixelType("f32");const f=e.clone();f.pixelType=this.outputPixelType,f.bandCount=g.length;const{statistics:p,histograms:I}=f;null!=p&&p.length&&(f.statistics=g.map(t=>p[t]||p[p.length-1])),null!=I&&I.length&&(f.histograms=g.map(t=>I[t]||I[I.length-1])),f.multidimensionalInfo&&f.multidimensionalInfo.variables.forEach(t=>{const{statistics:n,histograms:e}=t;null!=n&&n.length&&(t.statistics=g.map(t=>n[t]||n[n.length-1])),null!=e&&e.length&&(t.histograms=g.map(t=>e[t]||e[e.length-1]))});let b=f.keyProperties?.BandProperties;b?.length&&(b=g.map(t=>t>=b.length?b[b.length-1]:b[t]),f.keyProperties={...f.keyProperties,BandProperties:b}),this.rasterInfo=f;return{success:!0,supportsGPU:f.bandCount<=3}}_processPixels(t){const n=t.pixelBlocks?.[0];if(null==n)return null;let{bandIds:e}=this.functionArguments;if(this.rasterInfo.storageInfo.isBsqTile){const{rawInputBandIds:t}=this;e=e.map(n=>t.indexOf(n))}else{const t=n.pixels.length;e=e.map(n=>n>=t?t-1:n)}return n.extractBands(e)}_getWebGLParameters(){let t;if(this.isInputBandIdsSwizzled)t=this.swizzledBandSelection.length?this.swizzledBandSelection:[0,1,2];else{t=[...this.functionArguments.bandIds],0===t.length?t=[0,1,2]:t.length<3&&(t[1]=t[1]??t[0],t[2]=t[2]??t[1]);for(let n=0;n<3;n++)t[n]=Math.min(t[n],2)}return{bandIndexMat3:s(t)}}_getInputBandIds(t){const n=t.length;return this.functionArguments.bandIds.map(t=>t>=n?n-1:t).map(n=>t[n])}_swizzleBandIds(t){const n=this.functionArguments.bandIds.map(n=>t.indexOf(n));return this.isInputBandIdsSwizzled=!0,n[1]??=n[0],n[2]??=n[1],this.swizzledBandSelection=n,!1}};t([n({json:{write:!0,name:"rasterFunction"}})],a.prototype,"functionName",void 0),t([n({type:i,json:{write:!0,name:"rasterFunctionArguments"}})],a.prototype,"functionArguments",void 0),t([n()],a.prototype,"rasterArgumentNames",void 0),a=t([e("esri.layers.raster.functions.ExtractBandFunction")],a);const o=a;function l(t,n){const e=t.bandInfos.map(({name:t})=>t.toLowerCase()),s=[];for(let r=0;r<n.length;r++){const t=n[r].toLowerCase();let i=e.indexOf(t);if(-1===i&&"nearinfrared"===t&&(i=e.findIndex(t=>t.startsWith("nearinfrared_1")),-1===i&&(i=e.findIndex(t=>t.startsWith("nearinfrared")))),-1===i)return null;s.push(i)}return s}function u(t,n,e){const{bandCount:s}=t;return!n?.length||e&&n.some(t=>t<0||t>=s)?null:n}function d(t,n,{wavelengthMatchTolerance:e},s){const{bandInfos:r}=t,i=[];for(let o=0;o<r.length;o++){const{minWavelength:t,maxWavelength:n}=r[o];if(!t||!n)return null;i.push({minWavelength:t,maxWavelength:n})}const a=[];for(let o=0;o<n.length;o++){const t=n[o];let r=!1,l=-1,u=Number.MAX_VALUE;for(let n=0;n<i.length;n++){const e=i[n],s=t>=e.minWavelength&&t<=e.maxWavelength,a=Math.abs(t-(e.minWavelength+e.maxWavelength)/2);s?a<u&&(r=!0,l=n,u=a):!r&&a<u&&(l=n,u=a)}if(!r&&e&&u<e&&(r=!0),!r&&s)return null;a.push(l)}return a}export{o 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 o from"./BaseFunctionArguments.js";import{enumeration as n}from"../../../core/accessorSupport/decorators/enumeration.js";var a;let
|
|
5
|
+
import{__decorate as t}from"tslib";import{property as e,subclass as s}from"../../../core/accessorSupport/decorators.js";import o from"./BaseFunctionArguments.js";import{enumeration as n}from"../../../core/accessorSupport/decorators/enumeration.js";var a;let i=a=class extends o{constructor(){super(...arguments),this.bandIds=[],this.bandNames=[],this.bandWavelengths=[],this.missingBandAction=0}clone(){return new a({bandIds:this.bandIds?.slice(),bandNames:this.bandNames?.slice(),bandWavelengths:this.bandWavelengths?.slice(),missingBandAction:this.missingBandAction,method:this.method,wavelengthMatchTolerance:this.wavelengthMatchTolerance})}};t([e({json:{write:!0}})],i.prototype,"bandIds",void 0),t([e({json:{write:!0}})],i.prototype,"bandNames",void 0),t([e({json:{write:!0}})],i.prototype,"bandWavelengths",void 0),t([n({0:"name",1:"wavelength",2:"id"})],i.prototype,"method",void 0),t([e({json:{write:!0}})],i.prototype,"missingBandAction",void 0),t([e({json:{write:!0}})],i.prototype,"wavelengthMatchTolerance",void 0),i=a=t([s("esri.layers.raster.functions.ExtractBandFunctionArguments")],i);const r=i;export{r 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{grayscale as o}from"./conversionUtils.js";import n from"./GrayscaleFunctionArguments.js";let i=class extends r{constructor(){super(...arguments),this.functionName="Grayscale",this.functionArguments=null,this.rasterArgumentNames=["raster"]}get _normalizedWeights(){const{conversionParameters:t}=this.functionArguments,e=t.reduce((t,e)=>t+e);return t.map(t=>t/e)}_bindSourceRasters(){const{conversionParameters:t}=this.functionArguments;if(!t?.length)return{success:!1,supportsGPU:!1,error:"missing valid conversion parameters."};const e=this.sourceRasterInfos[0].clone();this.outputPixelType=this._getOutputPixelType(e.pixelType),e.pixelType=this.outputPixelType;const s=3===t.length||3===e.bandCount&&t.length>3;return e.bandCount=1,this._removeStatsHistColormapVAT(e),this.rasterInfo=e,{success:!0,supportsGPU:s}}_processPixels(t){const e=t.pixelBlocks?.[0];return null==e?null:o(e,this._normalizedWeights,this.outputPixelType)}_getWebGLParameters(){return{weights:this._normalizedWeights}}};t([e({json:{write:!0,name:"rasterFunction"}})],i.prototype,"functionName",void 0),t([e({type:n,json:{write:!0,name:"rasterFunctionArguments"}})],i.prototype,"functionArguments",void 0),t([e()],i.prototype,"rasterArgumentNames",void 0),t([e()],i.prototype,"_normalizedWeights",null),i=t([s("esri.layers.
|
|
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{grayscale as o}from"./conversionUtils.js";import n from"./GrayscaleFunctionArguments.js";let i=class extends r{constructor(){super(...arguments),this.functionName="Grayscale",this.functionArguments=null,this.rasterArgumentNames=["raster"]}get _normalizedWeights(){const{conversionParameters:t}=this.functionArguments,e=t.reduce((t,e)=>t+e);return t.map(t=>t/e)}_bindSourceRasters(){const{conversionParameters:t}=this.functionArguments;if(!t?.length)return{success:!1,supportsGPU:!1,error:"missing valid conversion parameters."};const e=this.sourceRasterInfos[0].clone();this.outputPixelType=this._getOutputPixelType(e.pixelType),e.pixelType=this.outputPixelType;const s=3===t.length||3===e.bandCount&&t.length>3;return e.bandCount=1,this._removeStatsHistColormapVAT(e),this.rasterInfo=e,{success:!0,supportsGPU:s}}_processPixels(t){const e=t.pixelBlocks?.[0];return null==e?null:o(e,this._normalizedWeights,this.outputPixelType)}_getWebGLParameters(){return{weights:this._normalizedWeights}}};t([e({json:{write:!0,name:"rasterFunction"}})],i.prototype,"functionName",void 0),t([e({type:n,json:{write:!0,name:"rasterFunctionArguments"}})],i.prototype,"functionArguments",void 0),t([e()],i.prototype,"rasterArgumentNames",void 0),t([e()],i.prototype,"_normalizedWeights",null),i=t([s("esri.layers.raster.functions.GrayscaleFunction")],i);const u=i;export{u 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 s}from"../../../core/accessorSupport/decorators.js";import t from"./BaseFunctionArguments.js";var o;let n=o=class extends t{clone(){return new o({conversionParameters:[...this.conversionParameters],raster:this.raster})}};r([e({type:[Number],json:{write:!0}})],n.prototype,"conversionParameters",void 0),n=o=r([s("esri.layers.
|
|
5
|
+
import{__decorate as r}from"tslib";import{property as e,subclass as s}from"../../../core/accessorSupport/decorators.js";import t from"./BaseFunctionArguments.js";var o;let n=o=class extends t{clone(){return new o({conversionParameters:[...this.conversionParameters],raster:this.raster})}};r([e({type:[Number],json:{write:!0}})],n.prototype,"conversionParameters",void 0),n=o=r([s("esri.layers.raster.functions.GrayscaleFunctionArguments")],n);const a=n;export{a 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 r from"./BaseRasterFunction.js";import o from"./HillshadeFunctionArguments.js";import{getHillshadeOptions as n,hillshade as u,calculateHillshadeParams as a,gcsFactor as p}from"./surfaceUtils.js";let c=class extends r{constructor(){super(...arguments),this.functionName="Hillshade",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1)return{success:!1,supportsGPU:!1,error:"hillshade-function: source data must be single band"};this.outputPixelType=this._getOutputPixelType("u8");const e=t.clone();return this._removeStatsHistColormapVAT(e),e.pixelType=this.outputPixelType,e.bandCount=1,e.statistics=[{min:0,max:255,avg:60,stddev:10}],this.rasterInfo=e,this.isGCS=e.spatialReference?.isGeographic??!1,{success:!0,supportsGPU:!0}}_processPixels(t){const e=t.pixelBlocks?.[0];if(!e)return null;const{extent:s,primaryPixelSizes:i}=t,r=i?.[0],o=r??(s?{x:s.width/e.width,y:s.height/e.height}:{x:1,y:1}),a=n(this.functionArguments,o,this.isGCS),p=u(e,a);return p.pixelType=this.outputPixelType,p}_getWebGLParameters(){const t=n(this.functionArguments,{x:1,y:1},this.isGCS),e=a(t),{slopeType:s,zFactor:r,pixelSizeFactor:o,pixelSizePower:u}=this.functionArguments,c="scaled"===s,l=i(this.outputPixelType);return{...e,zFactor:r,gcsFactor:this.isGCS?p:1,pixelSizeFactor:c?o:0,pixelSizePower:c?u:0,isOutputRounded:l}}};t([e({json:{write:!0,name:"rasterFunction"}})],c.prototype,"functionName",void 0),t([e({type:o,json:{write:!0,name:"rasterFunctionArguments"}})],c.prototype,"functionArguments",void 0),t([e()],c.prototype,"rasterArgumentNames",void 0),t([e({json:{write:!0}})],c.prototype,"isGCS",void 0),c=t([s("esri.layers.raster.functions.HillshadeFunction")],c);const l=c;export{l 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 t}from"../../../core/jsonMap.js";import{property as o,subclass as r}from"../../../core/accessorSupport/decorators.js";import i from"./BaseFunctionArguments.js";import{enumeration as s}from"../../../core/accessorSupport/decorators/enumeration.js";var p;const a=new t({0:"traditional",1:"multi-directional"},{useNumericKeys:!0}),l=new t({1:"degree",2:"percent-rise",3:"scaled"},{useNumericKeys:!0});let c=p=class extends i{constructor(){super(...arguments),this.altitude=45,this.azimuth=315,this.hillshadeType="traditional",this.pixelSizePower=.664,this.pixelSizeFactor=.024,this.slopeType="degree",this.zFactor=1,this.removeEdgeEffect=!1}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,raster:this.raster})}};e([o({type:Number,json:{write:!0}})],c.prototype,"altitude",void 0),e([o({type:Number,json:{write:!0}})],c.prototype,"azimuth",void 0),e([o(),s(a)],c.prototype,"hillshadeType",void 0),e([o({type:Number,json:{write:!0,name:"psPower"}})],c.prototype,"pixelSizePower",void 0),e([o({type:Number,json:{write:!0,name:"psZFactor"}})],c.prototype,"pixelSizeFactor",void 0),e([o(),s(l)],c.prototype,"slopeType",void 0),e([o({type:Number,json:{write:!0}})],c.prototype,"zFactor",void 0),e([o({type:Boolean,json:{write:!0}})],c.prototype,"removeEdgeEffect",void 0),c=p=e([r("esri.layers.
|
|
5
|
+
import{__decorate as e}from"tslib";import{JSONMap as t}from"../../../core/jsonMap.js";import{property as o,subclass as r}from"../../../core/accessorSupport/decorators.js";import i from"./BaseFunctionArguments.js";import{enumeration as s}from"../../../core/accessorSupport/decorators/enumeration.js";var p;const a=new t({0:"traditional",1:"multi-directional"},{useNumericKeys:!0}),l=new t({1:"degree",2:"percent-rise",3:"scaled"},{useNumericKeys:!0});let c=p=class extends i{constructor(){super(...arguments),this.altitude=45,this.azimuth=315,this.hillshadeType="traditional",this.pixelSizePower=.664,this.pixelSizeFactor=.024,this.slopeType="degree",this.zFactor=1,this.removeEdgeEffect=!1}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,raster:this.raster})}};e([o({type:Number,json:{write:!0}})],c.prototype,"altitude",void 0),e([o({type:Number,json:{write:!0}})],c.prototype,"azimuth",void 0),e([o(),s(a)],c.prototype,"hillshadeType",void 0),e([o({type:Number,json:{write:!0,name:"psPower"}})],c.prototype,"pixelSizePower",void 0),e([o({type:Number,json:{write:!0,name:"psZFactor"}})],c.prototype,"pixelSizeFactor",void 0),e([o(),s(l)],c.prototype,"slopeType",void 0),e([o({type:Number,json:{write:!0}})],c.prototype,"zFactor",void 0),e([o({type:Boolean,json:{write:!0}})],c.prototype,"removeEdgeEffect",void 0),c=p=e([r("esri.layers.raster.functions.HillshadeFunctionArguments")],c);const n=c;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 n,isIntegerPixelType as o,getIntegerPixelType as i}from"../formats/pixelRangeUtils.js";import r from"./BaseRasterFunction.js";import u from"./LocalFunctionArguments.js";import{operandsCount as a,local as c,getOutputDomain as l}from"./localUtils.js";import{localOperators as p}from"../../support/rasterFunctionConstants.js";let m=class extends r{constructor(){super(...arguments),this.functionName="Local",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:t}=this,s=t[0],{bandCount:e}=s,{processAsMultiband:n}=this.functionArguments;if(t.some(t=>t.bandCount!==e))return{success:!1,supportsGPU:!1,error:"local-function: input rasters do not have same band count"};const{operation:o,rasters:i}=this.functionArguments,r=a[o];if(!(999===r||i.length===r||i.length<=1&&1===r))return{success:!1,supportsGPU:!1,error:`local-function: the length of functionArguments.rasters does not match operation's requirement: ${r}`};const u=s.clone();u.bandCount=999!==r||n?e:1,this._removeStatsHistColormapVAT(u),this._updateStatistics(u),this._updatePixelType(u),this.rasterInfo=u;return{success:!0,supportsGPU:1===u.bandCount&&r<=3}}_processPixels(t){const{pixelBlocks:s}=t;return null==s||s.some(t=>null==t)?null:c(s,this.functionArguments.operation,{processAsMultiband:this.functionArguments.processAsMultiband,outputPixelType:this.outputPixelType??void 0})}_getWebGLParameters(){const{operation:t}=this.functionArguments,s=a[t],e=Object.keys(p).find(s=>p[s]===t)?.toLowerCase()??"undefined",i=this.outputPixelType??"f32";let[r,u]=n(i);const c=o(i);return c&&(r-=1e-4,u+=1e-4),{imageCount:s,operationName:e,domainRange:[r,u],isOutputRounded:c}}_updateStatistics(t){const s=this.sourceRasterInfos[0],{operation:e}=this.functionArguments,n=l(e)?.domain;if(n){t.statistics=[];for(let s=0;s<t.bandCount;s++)t.statistics[s]={min:n[0],max:n[1],avg:(n[0]+n[1])/2,stddev:(n[0]+n[1])/10}}else 45===e&&s.statistics?.length&&(t.statistics=s.statistics.map(t=>({min:-t.max,max:-t.min,avg:null!=t.avg?-t.avg:void 0,stddev:null!=t.stddev?-t.stddev:void 0})))}_updatePixelType(t){const{statistics:s,pixelType:e}=this.sourceRasterInfos[0],{operation:n}=this.functionArguments,{domain:r,isInteger:u}=l(n)??{domain:null,isInteger:!1};let a="f32";if(r&&u)a=i(r[0],r[1]);else if(30===n){const t=s?.[0];a=t?i(t.min,t.max):o(e)?e:"s32"}else if(45===n&&o(e)){const t=s?.map(({max:t})=>-t),n=s?.map(({min:t})=>-t),o=t?.length?Math.min(...t):null,r=n?.length?Math.min(...n):null;a=null!=o&&null!=r?i(o,r):e.startsWith("s")?e.replace("s","u"):"u1"===e||"u2"===e||"u4"===e?"s8":"u8"===e?"s16":"s32"}t.pixelType=this.outputPixelType=this._getOutputPixelType(a)}};t([s({json:{write:!0,name:"rasterFunction"}})],m.prototype,"functionName",void 0),t([s({type:u,json:{write:!0,name:"rasterFunctionArguments"}})],m.prototype,"functionArguments",void 0),t([s()],m.prototype,"rasterArgumentNames",void 0),m=t([e("esri.layers.raster.functions.LocalFunction")],m);const d=m;export{d 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{clone as s}from"../../../core/lang.js";import{property as t,subclass as o}from"../../../core/accessorSupport/decorators.js";import e from"./BaseFunctionArguments.js";import{writer as i}from"../../../core/accessorSupport/decorators/writer.js";var
|
|
5
|
+
import{__decorate as r}from"tslib";import{clone as s}from"../../../core/lang.js";import{property as t,subclass as o}from"../../../core/accessorSupport/decorators.js";import e from"./BaseFunctionArguments.js";import{writer as i}from"../../../core/accessorSupport/decorators/writer.js";var a;let p=a=class extends e{constructor(){super(...arguments),this.rasters=[],this.processAsMultiband=!0}writeRasters(r,s){s.rasters=r.map(r=>"number"==typeof r||"string"==typeof r?r:r.toJSON())}clone(){return new a({operation:this.operation,processAsMultiband:this.processAsMultiband,rasters:s(this.rasters)})}};r([t({json:{write:!0}})],p.prototype,"operation",void 0),r([t({json:{write:!0}})],p.prototype,"rasters",void 0),r([i("rasters")],p.prototype,"writeRasters",null),r([t({json:{write:!0}})],p.prototype,"processAsMultiband",void 0),p=a=r([o("esri.layers.raster.functions.LocalFunctionArguments")],p);const n=p;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{numberMaxFloat32 as e}from"../../../core/mathUtils.js";import{property as s,subclass as n}from"../../../core/accessorSupport/decorators.js";import o from"./BaseRasterFunction.js";import r from"./MaskFunctionArguments.js";import{createMaskLUT as u,maxMapSizeGpu as i,mask as a}from"./pixelUtils.js";let l=class extends o{constructor(){super(...arguments),this.functionName="Mask",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone(),{pixelType:e}=t;this.outputPixelType=this._getOutputPixelType(e),t.pixelType=this.outputPixelType,this.rasterInfo=t;const{includedRanges:s,normalizedNoDataValues:n}=this.functionArguments;if(!s?.length&&!n?.length)return{success:!1,supportsGPU:!1,error:"missing includedRanges or noDataValues argument"};let o=[];for(let i=0;i<t.bandCount;i++){const t=u(e,s?.slice(2*i,2*i+2),n?.[i]);if(null==t){o=null;break}o.push(t)}this.lookups=o;const r=null!=n&&n.every(t=>t?.length===n[0]?.length);return{success:!0,supportsGPU:(!s||s.length<=2*i)&&(!n||r&&n[0].length<=i)}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return null;const{outputPixelType:s,lookups:n}=this,{includedRanges:o,noDataInterpretation:r,normalizedNoDataValues:u}=this.functionArguments;return a(e,{includedRanges:o,noDataValues:u,outputPixelType:s,matchAll:1===r,lookups:n})}_getWebGLParameters(){const{includedRanges:t,normalizedNoDataValues:s}=this.functionArguments,n=new Float32Array(i);n.fill(e),s?.[0]?.length&&n.set(s[0]);const o=new Float32Array(6);for(let r=0;r<o.length;r+=2)o[r]=t?.[r]??-e,o[r+1]=t?.[r+1]??e;return t?.length&&o.set(t),{bandCount:this.sourceRasterInfos[0].bandCount,noDataValues:n,includedRanges:o}}};t([s({json:{write:!0,name:"rasterFunction"}})],l.prototype,"functionName",void 0),t([s({type:r,json:{write:!0,name:"rasterFunctionArguments"}})],l.prototype,"functionArguments",void 0),t([s()],l.prototype,"rasterArgumentNames",void 0),t([s({json:{write:!0}})],l.prototype,"lookups",void 0),l=t([n("esri.layers.
|
|
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 o from"./BaseRasterFunction.js";import r from"./MaskFunctionArguments.js";import{createMaskLUT as u,maxMapSizeGpu as i,mask as a}from"./pixelUtils.js";let l=class extends o{constructor(){super(...arguments),this.functionName="Mask",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone(),{pixelType:e}=t;this.outputPixelType=this._getOutputPixelType(e),t.pixelType=this.outputPixelType,this.rasterInfo=t;const{includedRanges:s,normalizedNoDataValues:n}=this.functionArguments;if(!s?.length&&!n?.length)return{success:!1,supportsGPU:!1,error:"missing includedRanges or noDataValues argument"};let o=[];for(let i=0;i<t.bandCount;i++){const t=u(e,s?.slice(2*i,2*i+2),n?.[i]);if(null==t){o=null;break}o.push(t)}this.lookups=o;const r=null!=n&&n.every(t=>t?.length===n[0]?.length);return{success:!0,supportsGPU:(!s||s.length<=2*i)&&(!n||r&&n[0].length<=i)}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return null;const{outputPixelType:s,lookups:n}=this,{includedRanges:o,noDataInterpretation:r,normalizedNoDataValues:u}=this.functionArguments;return a(e,{includedRanges:o,noDataValues:u,outputPixelType:s,matchAll:1===r,lookups:n})}_getWebGLParameters(){const{includedRanges:t,normalizedNoDataValues:s}=this.functionArguments,n=new Float32Array(i);n.fill(e),s?.[0]?.length&&n.set(s[0]);const o=new Float32Array(6);for(let r=0;r<o.length;r+=2)o[r]=t?.[r]??-e,o[r+1]=t?.[r+1]??e;return t?.length&&o.set(t),{bandCount:this.sourceRasterInfos[0].bandCount,noDataValues:n,includedRanges:o}}};t([s({json:{write:!0,name:"rasterFunction"}})],l.prototype,"functionName",void 0),t([s({type:r,json:{write:!0,name:"rasterFunctionArguments"}})],l.prototype,"functionArguments",void 0),t([s()],l.prototype,"rasterArgumentNames",void 0),t([s({json:{write:!0}})],l.prototype,"lookups",void 0),l=t([n("esri.layers.raster.functions.MaskFunction")],l);const c=l;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 n}from"../../../core/accessorSupport/decorators.js";import r from"./BaseFunctionArguments.js";var o;let a=o=class extends r{constructor(){super(...arguments),this.includedRanges=null,this.noDataValues=null,this.noDataInterpretation=0}get normalizedNoDataValues(){const{noDataValues:t}=this;if(!t?.length)return null;let e=!1;const n=t.map(t=>{if("number"==typeof t)return e=!0,[t];if("string"==typeof t){const n=t.trim().split(" ").filter(t=>""!==t.trim()).map(t=>Number(t));return e=e||n.length>0,0===n.length?null:n}return null});return e?n:null}clone(){return new o({includedRanges:this.includedRanges?.slice()??[],noDataValues:this.noDataValues?.slice()??[],noDataInterpretation:this.noDataInterpretation})}};t([e({json:{write:!0}})],a.prototype,"includedRanges",void 0),t([e({json:{write:!0}})],a.prototype,"noDataValues",void 0),t([e()],a.prototype,"normalizedNoDataValues",null),t([e({json:{write:!0}})],a.prototype,"noDataInterpretation",void 0),a=o=t([n("esri.layers.
|
|
5
|
+
import{__decorate as t}from"tslib";import{property as e,subclass as n}from"../../../core/accessorSupport/decorators.js";import r from"./BaseFunctionArguments.js";var o;let a=o=class extends r{constructor(){super(...arguments),this.includedRanges=null,this.noDataValues=null,this.noDataInterpretation=0}get normalizedNoDataValues(){const{noDataValues:t}=this;if(!t?.length)return null;let e=!1;const n=t.map(t=>{if("number"==typeof t)return e=!0,[t];if("string"==typeof t){const n=t.trim().split(" ").filter(t=>""!==t.trim()).map(t=>Number(t));return e=e||n.length>0,0===n.length?null:n}return null});return e?n:null}clone(){return new o({includedRanges:this.includedRanges?.slice()??[],noDataValues:this.noDataValues?.slice()??[],noDataInterpretation:this.noDataInterpretation})}};t([e({json:{write:!0}})],a.prototype,"includedRanges",void 0),t([e({json:{write:!0}})],a.prototype,"noDataValues",void 0),t([e()],a.prototype,"normalizedNoDataValues",null),t([e({json:{write:!0}})],a.prototype,"noDataInterpretation",void 0),a=o=t([n("esri.layers.raster.functions.MaskFunctionArguments")],a);const s=a;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 t}from"tslib";import{property as s,subclass as n}from"../../../core/accessorSupport/decorators.js";import{calculateNDVI as e,getBandMatrix3 as i}from"./bandIndexUtils.js";import r from"./BaseRasterFunction.js";import o from"./NDVIFunctionArguments.js";let
|
|
5
|
+
import{__decorate as t}from"tslib";import{property as s,subclass as n}from"../../../core/accessorSupport/decorators.js";import{calculateNDVI as e,getBandMatrix3 as i}from"./bandIndexUtils.js";import r from"./BaseRasterFunction.js";import o from"./NDVIFunctionArguments.js";let a=class extends r{constructor(){super(...arguments),this.functionName="NDVI",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{scientificOutput:t,visibleBandID:s,infraredBandID:n}=this.functionArguments;this.outputPixelType=this._getOutputPixelType(t?"f32":"u8");const e=this.sourceRasterInfos[0],i=Math.max(s,n);if(e.bandCount<2||i>=e.bandCount)return{success:!1,supportsGPU:!1,error:"ndvi-function: source raster has insufficient amount of raster bands"};if(s<0||n<0)return{success:!1,supportsGPU:!1,error:"ndvi-function: invalid visible or infrared band id"};const r=e.clone();r.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(r),r.bandCount=1,r.keyProperties={...r.keyProperties,BandProperties:void 0};const[o,a,u,d]=t?[-1,1,0,.1]:[0,200,100,10];return r.statistics=[{min:o,max:a,avg:u,stddev:d}],this.rasterInfo=r,{success:!0,supportsGPU:!0}}_processPixels(t){const s=t.pixelBlocks?.[0];if(null==s)return null;let{visibleBandID:n,infraredBandID:i,scientificOutput:r}=this.functionArguments;if(this.rasterInfo.storageInfo.isBsqTile){const{rawInputBandIds:t}=this;i=t.indexOf(i),n=t.indexOf(n)}return e(s,n,i,!r)}_getWebGLParameters(){const{visibleBandID:t,infraredBandID:s,scientificOutput:n}=this.functionArguments,e=this.isInputBandIdsSwizzled?[0,1,2]:[s,t,0];return{bandIndexMat3:i(e),scaled:!n}}_getInputBandIds(t){const{visibleBandID:s,infraredBandID:n}=this.functionArguments;return[n,s,0].map(s=>t[s])}_swizzleBandIds(t){const{visibleBandID:s,infraredBandID:n}=this.functionArguments,e=[s,n].map(s=>t.indexOf(s));return e[2]=e[1],this.isInputBandIdsSwizzled=!0,this.swizzledBandSelection=e,!1}};t([s({json:{write:!0,name:"rasterFunction"}})],a.prototype,"functionName",void 0),t([s({type:o,json:{write:!0,name:"rasterFunctionArguments"}})],a.prototype,"functionArguments",void 0),t([s()],a.prototype,"rasterArgumentNames",void 0),a=t([n("esri.layers.raster.functions.NDVIFunction")],a);const u=a;export{u 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 i,subclass as r}from"../../../core/accessorSupport/decorators.js";import
|
|
5
|
+
import{__decorate as t}from"tslib";import{property as i,subclass as r}from"../../../core/accessorSupport/decorators.js";import e from"./BaseFunctionArguments.js";var s;let n=s=class extends e{constructor(){super(...arguments),this.visibleBandID=0,this.infraredBandID=1,this.scientificOutput=!1}clone(){const{visibleBandID:t,infraredBandID:i,scientificOutput:r}=this;return new s({visibleBandID:t,infraredBandID:i,scientificOutput:r})}};t([i({json:{write:!0}})],n.prototype,"visibleBandID",void 0),t([i({json:{write:!0}})],n.prototype,"infraredBandID",void 0),t([i({json:{write:!0}})],n.prototype,"scientificOutput",void 0),n=s=t([r("esri.layers.raster.functions.NDVIFunctionArguments")],n);const o=n;export{o as default};
|