/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["../chunks/_rollupPluginBabelHelpers","../chunks/tslib.es6","../core/JSONSupport","../core/lang","../core/accessorSupport/decorators/property","../core/accessorSupport/ensureType","../core/accessorSupport/decorators/enumeration","../core/accessorSupport/decorators/reader","../core/accessorSupport/decorators/subclass","../core/accessorSupport/decorators/writer","./support/stretchRendererUtils","../rest/support/colorRamps"],(function(e,t,r,o,a,p,s,i,n,c,u,m){"use strict";var d;let y=d=function(t){function r(e){var r;return(r=t.call(this,e)||this).colorRamp=null,r.computeGamma=!1,r.dynamicRangeAdjustment=!1,r.gamma=[],r.maxPercent=null,r.minPercent=null,r.numberOfStandardDeviations=null,r.outputMax=null,r.outputMin=null,r.sigmoidStrengthLevel=null,r.statistics=[],r.histograms=null,r.useGamma=!1,r.stretchType="none",r.type="raster-stretch",r}e._inheritsLoose(r,t);var a=r.prototype;return a.readColorRamp=function(e){if(e)return m.fromJSON(e)},a.writeStatistics=function(e,t,r){var o;null!=(o=e)&&o.length&&(Array.isArray(e[0])||(e=e.map((e=>[e.min,e.max,e.avg,e.stddev]))),t[r]=e)},a.readStretchType=function(e,t){let r=t.stretchType;return"number"==typeof r&&(r=u.stretchTypeFunctionEnum[r]),u.stretchTypeJSONDict.read(r)},a.clone=function(){return new d({stretchType:this.stretchType,outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,statistics:o.clone(this.statistics),gamma:o.clone(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,minPercent:this.minPercent,maxPercent:this.maxPercent,colorRamp:o.clone(this.colorRamp),histograms:o.clone(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment})},r}(r.JSONSupport);t.__decorate([a.property({types:m.types,json:{write:!0}})],y.prototype,"colorRamp",void 0),t.__decorate([i.reader("colorRamp")],y.prototype,"readColorRamp",null),t.__decorate([a.property({type:Boolean,json:{write:!0}})],y.prototype,"computeGamma",void 0),t.__decorate([a.property({type:Boolean,json:{write:{target:"dra"},read:{source:"dra"}}})],y.prototype,"dynamicRangeAdjustment",void 0),t.__decorate([a.property({type:[Number],json:{write:!0}})],y.prototype,"gamma",void 0),t.__decorate([a.property({type:Number,json:{write:!0}})],y.prototype,"maxPercent",void 0),t.__decorate([a.property({type:Number,json:{write:!0}})],y.prototype,"minPercent",void 0),t.__decorate([a.property({type:Number,json:{write:!0}})],y.prototype,"numberOfStandardDeviations",void 0),t.__decorate([a.property({type:Number,json:{read:{source:"max"},write:{target:"max"}}})],y.prototype,"outputMax",void 0),t.__decorate([a.property({type:Number,json:{read:{source:"min"},write:{target:"min"}}})],y.prototype,"outputMin",void 0),t.__decorate([a.property({type:Number,json:{write:!0}})],y.prototype,"sigmoidStrengthLevel",void 0),t.__decorate([a.property({json:{type:[[Number]],write:!0}})],y.prototype,"statistics",void 0),t.__decorate([a.property()],y.prototype,"histograms",void 0),t.__decorate([c.writer("statistics")],y.prototype,"writeStatistics",null),t.__decorate([a.property({type:Boolean,json:{write:!0}})],y.prototype,"useGamma",void 0),t.__decorate([a.property({type:u.stretchTypeJSONDict.apiValues,json:{type:u.stretchTypeJSONDict.jsonValues,write:u.stretchTypeJSONDict.write}})],y.prototype,"stretchType",void 0),t.__decorate([i.reader("stretchType",["stretchType"])],y.prototype,"readStretchType",null),t.__decorate([s.enumeration({rasterStretch:"raster-stretch"})],y.prototype,"type",void 0),y=d=t.__decorate([n.subclass("esri.renderers.RasterStretchRenderer")],y);return y}));
