UNPKG

@arcgis/core

Version:

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

6 lines (5 loc) 2.11 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. */ import{createRasterFunction as t}from"./utils.js";const e={"user-defined":-1,"line-detection-horizontal":0,"line-detection-vertical":1,"line-detection-left-diagonal":2,"line-detection-right-diagonal":3,"gradient-north":4,"gradient-west":5,"gradient-east":6,"gradient-south":7,"gradient-north-east":8,"gradient-north-west":9,"smooth-arithmetic-mean":10,smoothing3x3:11,smoothing5x5:12,sharpening3x3:13,sharpening5x5:14,laplacian3x3:15,laplacian5x5:16,"sobel-horizontal":17,"sobel-vertical":18,sharpen:19,sharpen2:20,"point-spread":21,none:255};function n(n){const{raster:r,outputPixelType:o}=n;if("convolutionType"in n&&"user-defined"!==n.convolutionType){const i=e[n.convolutionType]??255;return t("Convolution",{type:i,raster:r},o)}const{rows:i,cols:s,kernel:a}=n;return t("Convolution",{type:-1,rows:i,cols:s,kernel:a,raster:r},o)}function r(e){const{contrastOffset:n,brightnessOffset:r,raster:o,outputPixelType:i}=e;return t("ContrastBrightness",{contrastOffset:n,brightnessOffset:r,raster:o},i)}function o(t,e){const{raster:n,dynamicRangeAdjustment:r,gamma:o,useGamma:i,outputMin:s=0,outputMax:a=255}=e;return{raster:n,stretchType:t,min:s,max:a,useGamma:!!i,gamma:o,dra:!!r}}function i(e){const n=o(5,e);return n.statistics=e.statistics?.map((t=>[t.min,t.max,t.avg??0,t.stddev??-1])),t("Stretch",n,e.outputPixelType)}function s(e){const n=o(3,e);return n.statistics=e.statistics?.map((t=>[t.min,t.max,t.avg??0,t.stddev??-1])),n.numberOfStandardDeviations=e.numberOfStandardDeviations??2,t("Stretch",n,e.outputPixelType)}function a(e){const n=o(6,e);return n.minPercent=e.minPercent??.25,n.maxPercent=e.maxPercent??.25,t("Stretch",n,e.outputPixelType)}function c(e){const n=o(0,e);return t("Stretch",n,e.outputPixelType)}function u(e){const n=o(4,e);return t("Stretch",n,e.outputPixelType)}export{r as contrastBrightness,n as convolution,u as stretchHistogramEqualization,i as stretchMinMax,c as stretchNone,a as stretchPercentClip,s as stretchStandardDeviation};