/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
import{__decorate as t}from"tslib";import{define as o,uniform as r,option as i}from"../../../GraphShaderModule.js";import{Vec4 as s,Float as e}from"../../../graph/glsl.js";import{BaseRasterColorizerShader as p}from"./BaseRasterColorizerShader.js";import{lookupColor as a,ColormapConfig as h}from"./lut.js";import{stretch as m,stretchWithStatisticsTexture as l,StretchConfig as n,StatisticsConfig as d}from"./stretch.js";class c extends p{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:p,statisticsConfig:h}=this;let n=0===r?m(o,i,p):l(o,i,h,p,2===r);if(this.isMultiband)return n;if(n=new s(n.rrr,n.a),this.applyColormap){const t=this.useGamma?255:1;n=a(n,new e(t),this.colormapConfig)}return n}}t([o],c.prototype,"isMultiband",void 0),t([o],c.prototype,"applyColormap",void 0),t([o],c.prototype,"useGamma",void 0),t([o],c.prototype,"noOp",void 0),t([o],c.prototype,"draStretchType",void 0),t([r(n)],c.prototype,"stretchConfig",void 0),t([i(h)],c.prototype,"colormapConfig",void 0),t([i(d)],c.prototype,"statisticsConfig",void 0);export{c as RasterColorizerStretchShader};
