UNPKG

@arcgis/core

Version:

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

6 lines (5 loc) 4.09 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. */ import{_ as t}from"../chunks/tslib.es6.js";import{deprecatedProperty as e}from"../core/deprecate.js";import r from"../core/JSONSupport.js";import{clone as s}from"../core/lang.js";import o from"../core/Logger.js";import{property as i}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import{enumeration as a}from"../core/accessorSupport/decorators/enumeration.js";import{reader as m}from"../core/accessorSupport/decorators/reader.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import{writer as n}from"../core/accessorSupport/decorators/writer.js";import{stretchTypeJSONDict as c,stretchTypeFunctionEnum as u}from"./support/stretchRendererUtils.js";import{fromJSON as d,types as h}from"../rest/support/colorRamps.js";var l;let y=l=class extends r{constructor(t){super(t),this.colorRamp=null,this.computeGamma=!1,this.dynamicRangeAdjustment=!1,this.gamma=[],this.maxPercent=null,this.minPercent=null,this.numberOfStandardDeviations=null,this.outputMax=null,this.outputMin=null,this.sigmoidStrengthLevel=null,this.histograms=null,this.useGamma=!1,this.stretchType="none",this.type="raster-stretch"}readColorRamp(t){if(t)return d(t)}get statistics(){return this._get("statistics")}set statistics(t){e(o.getLogger(this),"statistics",{replacement:"customStatistics",version:"4.31",warnOnce:!0}),this._set("statistics",t)}get customStatistics(){const t=this.statistics;return t&&Array.isArray(t[0])?t.map((t=>({min:t[0],max:t[1],avg:t[2],stddev:t[3]}))):t}set customStatistics(t){this._set("statistics",t?.map((t=>[t.min,t.max,t.avg??0,t.stddev??1])))}readCustomStatistics(t){return t?.map((t=>({min:t[0],max:t[1],avg:t[2],stddev:t[3]})))}writeCustomStatistics(t,e,r){t?.length&&(e[r]=t.map((t=>[t.min,t.max,t.avg??0,t.stddev??1])))}readStretchType(t,e){let r=e.stretchType;return"number"==typeof r&&(r=u[r]),c.read(r)}clone(){const t=new l({stretchType:this.stretchType,outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,gamma:s(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,minPercent:this.minPercent,maxPercent:this.maxPercent,colorRamp:s(this.colorRamp),histograms:s(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment});return t._set("statistics",s(this.statistics)),t}};t([i({types:h,json:{write:!0}})],y.prototype,"colorRamp",void 0),t([m("colorRamp")],y.prototype,"readColorRamp",null),t([i({type:Boolean,json:{write:!0}})],y.prototype,"computeGamma",void 0),t([i({type:Boolean,json:{write:{target:"dra"},read:{source:"dra"}}})],y.prototype,"dynamicRangeAdjustment",void 0),t([i({type:[Number],json:{write:!0}})],y.prototype,"gamma",void 0),t([i({type:Number,json:{write:!0}})],y.prototype,"maxPercent",void 0),t([i({type:Number,json:{write:!0}})],y.prototype,"minPercent",void 0),t([i({type:Number,json:{write:!0}})],y.prototype,"numberOfStandardDeviations",void 0),t([i({type:Number,json:{read:{source:"max"},write:{target:"max"}}})],y.prototype,"outputMax",void 0),t([i({type:Number,json:{read:{source:"min"},write:{target:"min"}}})],y.prototype,"outputMin",void 0),t([i({type:Number,json:{write:!0}})],y.prototype,"sigmoidStrengthLevel",void 0),t([i({})],y.prototype,"statistics",null),t([i()],y.prototype,"histograms",void 0),t([i({json:{type:[[Number]],name:"statistics",write:!0}})],y.prototype,"customStatistics",null),t([m("customStatistics")],y.prototype,"readCustomStatistics",null),t([n("customStatistics")],y.prototype,"writeCustomStatistics",null),t([i({type:Boolean,json:{write:!0}})],y.prototype,"useGamma",void 0),t([i({type:c.apiValues,json:{type:c.jsonValues,write:c.write}})],y.prototype,"stretchType",void 0),t([m("stretchType",["stretchType"])],y.prototype,"readStretchType",null),t([a({rasterStretch:"raster-stretch"})],y.prototype,"type",void 0),y=l=t([p("esri.renderers.RasterStretchRenderer")],y);export{y as default};