/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{__decorate as t}from"tslib";import{define as o,uniform as r,option as i,texture as s}from"../../../GraphShaderModule.js";import{Vec4 as e,Float as p}from"../../../graph/glsl.js";import{BaseRasterColorizerShader as a}from"./BaseRasterColorizerShader.js";import{lookupColor as m,ColormapConfig as h,ColormapTextures as l}from"./lut.js";import{stretch as c,stretchWithStatisticsTexture as n,StretchConfig as d,StatisticsConfig as u,StatisticsTextures as y}from"./stretch.js";class f extends a{constructor(){super(...arguments),this.type="RasterColorizerStretchShader",this.isMultiband=!0,this.applyColormap=!1,this.useGamma=!1,this.noOp=!1,this.draStretchType=0}_colorize(t){const o=this._getPixel(t);if(this.noOp)return o;const{draStretchType:r,stretchConfig:i,useGamma:s,statisticsConfig:a,statisticsTextures:h}=this;let l=0===r?c(o,i,s):n(o,i,a,h,s,2===r);if(this.isMultiband)return l;if(l=new e(l.rrr,l.a),this.applyColormap){const t=this.useGamma?255:1;l=m(l,new p(t),this.colormapConfig,this.colormapTextures)}return l}}t([o],f.prototype,"isMultiband",void 0),t([o],f.prototype,"applyColormap",void 0),t([o],f.prototype,"useGamma",void 0),t([o],f.prototype,"noOp",void 0),t([o],f.prototype,"draStretchType",void 0),t([r(d)],f.prototype,"stretchConfig",void 0),t([i(h)],f.prototype,"colormapConfig",void 0),t([s(l)],f.prototype,"colormapTextures",void 0),t([i(u)],f.prototype,"statisticsConfig",void 0),t([s(y)],f.prototype,"statisticsTextures",void 0);export{f as RasterColorizerStretchShader};
