/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import{__decorate as t}from"tslib";import{property as e,subclass as s}from"../../../core/accessorSupport/decorators.js";import{getPixelValueRange as r}from"../formats/pixelRangeUtils.js";import o from"./BaseRasterFunction.js";import{spectralConversion as n}from"./conversionUtils.js";import i from"./SpectralConversionFunctionArguments.js";let u=class extends o{constructor(){super(...arguments),this.functionName="SpectralConversion",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone();this.outputPixelType=this._getOutputPixelType(t.pixelType),t.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(t),this.rasterInfo=t;return{success:!0,supportsGPU:3===t.bandCount&&9===this.functionArguments.conversionMatrix.length}}_processPixels(t){const e=t.pixelBlocks?.[0];return null==e?null:n(e,this.functionArguments.conversionMatrix,this.outputPixelType)}_getWebGLParameters(){const t=r(this.outputPixelType),[e,s,o,n,i,u,p,c,a]=this.functionArguments.conversionMatrix;return{weights:[e,n,p,s,i,c,o,u,a],clampRange:t}}};t([e({json:{write:!0,name:"rasterFunction"}})],u.prototype,"functionName",void 0),t([e({type:i,json:{write:!0,name:"rasterFunctionArguments"}})],u.prototype,"functionArguments",void 0),t([e()],u.prototype,"rasterArgumentNames",void 0),u=t([s("esri.layers.raster.functions.SpectralConversionFunction")],u);const p=u;export{p as default};
