/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../chunks/_rollupPluginBabelHelpers","../../../core/Error","../../../renderers/support/rasterRendererHelper","../support/utils"],(function(e,t,r,n,a){"use strict";function s(e){return i.apply(this,arguments)}function i(){return(i=t._asyncToGenerator((function*(e){e=yield a.processRasterRendererParameters(e);const{rasterInfo:t}=e.layer;if(1===t.bandCount)throw new r("raster-rgb-renderer:not-supported","Only multiband image is supported");const{rgbBandIds:s}=e;if(s&&3!==s.length)throw new r("raster-rgb-renderer:invalid-parameters","rgb band ids must have exactly three 0-based band indices");return s||(e.rgbBandIds=n.getDefaultBandCombination(t)),e}))).apply(this,arguments)}function d(e){return u.apply(this,arguments)}function u(){return(u=t._asyncToGenerator((function*(e){const t=(e=yield s(e)).layer,{rasterInfo:r}=t,{rgbBandIds:a}=e,i={bandIds:a,stretchType:e.stretchType,includeStatisticsInStretch:e.includeStatisticsInStretch};let d=n.createStretchRenderer(r,i);return e.estimateStatistics&&d.dynamicRangeAdjustment&&(yield t.updateRasterInfoWithEstimatedStats({renderingRule:e.renderingRule,signal:e.signal}),d=n.createStretchRenderer(r,i)),l(d,e),{renderer:d,rgbBandIds:a}}))).apply(this,arguments)}function l(e,t){const{gamma:r,useGamma:n,dynamicRangeAdjustment:a}=t;3===(null==r?void 0:r.length)&&(e.gamma=r),null!=n&&(e.useGamma=n),null!=a&&(e.dynamicRangeAdjustment=a)}e.createRenderer=d,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
