// All material copyright Esri, All Rights Reserved, unless otherwise specified. // See https://js.arcgis.com/4.30/esri/copyright.txt for details. //>>built define(["exports","../../../core/maybe","../../../chunks/RasterColorizer.glsl","../../webgl/enums","../../webgl/rasterUtils"],function(h,d,m,k,e){const l={bandCount:3,outMin:0,outMax:1,minCutOff:[0,0,0],maxCutOff:[255,255,255],factor:[1/255,1/255,1/255],useGamma:!1,gamma:[1,1,1],gammaCorrection:[1,1,1],colormap:null,colormapOffset:null,stretchType:"none",type:"stretch"};class n{constructor(a,b,c=null,f=null){this.lij=a;this.type="raster-tile";this._interpolation=this._bandIds=this._symbolizerParameters= this._source=this._memoryUsed=null;this._dirty=!1;this._transformGrid=null;this.isRendereredSource=!1;this.rawPixelData=this.symbolizerRenderer=null;this.opacity=1;this.source=b;this.width=c||b.width;this.height=f||b.height}get source(){return this._source}set source(a){this._source=a;this._rasterTexture=d.disposeMaybe(this._rasterTexture);this._memoryUsed=null}get symbolizerParameters(){return this.isRendereredSource?{...l,maxCutOff:[1,1,1],factor:[1,1,1]}:this._symbolizerParameters||l}set symbolizerParameters(a){this._symbolizerParameters= a}get bandIds(){return this._bandIds}set bandIds(a){null!=a&&0this._bandIds?.[c]?b===this._bandIds[c]:!1)||(this._bandIds=a,this._dirty=!0):this._bandIds=null}get interpolation(){return this._interpolation||"nearest"}set interpolation(a){this._interpolation=a;null!=this._rasterTexture&&(a=this._getRasterTextureInterpolation(a),this._rasterTexture.setSamplingMode("bilinear"===a?k.TextureSamplingMode.LINEAR:k.TextureSamplingMode.NEAREST))}get transformGrid(){return this._transformGrid}set transformGrid(a){this._transformGrid= a;this._transformGridTexture=d.disposeMaybe(this._transformGridTexture);this._memoryUsed=null}bind(a){if(!(this.source&&this.source.pixels&&0null!=a?a.descriptor.width*a.descriptor.height*4:0).reduce((a,b)=>a+b,0));return this._memoryUsed}release(){this._rasterTexture=d.disposeMaybe(this._rasterTexture);this._transformGridTexture=d.disposeMaybe(this._transformGridTexture);this._colormapTexture=d.disposeMaybe(this._colormapTexture); this.rawPixelData=this.transformGrid=this.source=null;return!0}_updateRasterTexture(a,b){const c=this.source?this.source.extractBands(b):null;c?.pixels&&0f!==b[g]))this._colormapTexture=d.disposeMaybe(this._colormapTexture),this._colormapTexture=e.createColormapTexture(a,c),this._colormap=c}}h.RasterTile=n;Object.defineProperty(h,Symbol.toStringTag,{value:"Module"})});