@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
6 lines (5 loc) • 1.84 kB
JavaScript
/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
*/
import{_ as t}from"../../../chunks/tslib.es6.js";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import s from"./BaseRasterFunction.js";import o from"./ClipFunctionArguments.js";import{clipRasterInfo as i}from"./clipUtils.js";import{projectExtent as p,projectPolygon as n}from"./rasterProjectionHelper.js";let c=class extends s{constructor(){super(...arguments),this.functionName="Clip",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone();this.outputPixelType=this._getOutputPixelType(t.pixelType),t.pixelType=this.outputPixelType,this.rasterInfo=t;const{functionArguments:e}=this,{clippingGeometry:r,clippingType:s}=e;if(!r)return{success:!1,supportsGPU:!1,error:"missing clipping geometry"};if("outside"===s)try{const{spatialReference:e}=t,s="extent"===r.type?p(r,e):n(r,e).extent;s&&i(t,s)}catch{}return{success:!0,supportsGPU:!0}}_processPixels(t){return t.pixelBlocks?.[0]}_getWebGLParameters(){const{clippingGeometry:t,clippingType:e}=this.functionArguments;return{clippingGeometry:t.toJSON(),clippingType:e}}};t([e({json:{write:!0,name:"rasterFunction"}})],c.prototype,"functionName",void 0),t([e({type:o,json:{write:!0,name:"rasterFunctionArguments"}})],c.prototype,"functionArguments",void 0),t([e()],c.prototype,"rasterArgumentNames",void 0),t([e()],c.prototype,"isNoopProcess",void 0),c=t([r("esri.layers.support.rasterFunctions.ClipFunction")],c);const u=c;export{u as default};