@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
6 lines (5 loc) • 1.62 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 e from"../../core/Error.js";import{PixelType as t,TextureSamplingMode as r,PixelFormat as o,SizedPixelFormat as a}from"./enums.js";class l{constructor(e,t,r,o){this.dataType=e,this.samplingMode=t,this.pixelFormat=r,this.internalFormat=o}}function n(n,i){const{textureFloatLinear:s,colorBufferFloat:f}=n.capabilities,u=f?.textureFloat,_=f?.textureHalfFloat,c=f?.floatBlend,m=n.driverTest.floatBufferBlend.result;if(!u&&!_)throw new e("heatmap:missing-color-buffer-float","HeatmapRenderer requires the WebGL extension EXT_color_buffer_float or EXT_color_buffer_half_float or WEBGL_color_buffer_float.");if(!(c&&m||_))throw new e("heatmap:missing-float-blend","HeatmapRenderer requires the WebGL extension EXT_float_blend or EXT_color_buffer_half_float."+(m?"":" This device claims support for EXT_float_blend, but does not actually support it."));const p=u&&c&&m,d=_,R=s,h=!!f?.R32F,b=!!f?.R16F;if(p&&R)return R||i.warnOnce("Missing WebGL extension OES_texture_float_linear. Heatmap quality may be reduced."),new l(t.FLOAT,R?r.LINEAR:r.NEAREST,h?o.RED:o.RGBA,h?a.R32F:o.RGBA);if(d)return new l(t.HALF_FLOAT,r.LINEAR,b?o.RED:o.RGBA,b?a.R16F:o.RGBA);throw new e("heatmap:missing-hardware-support","HeatmapRenderer requires WebGL extensions that allow it to render and blend to float or half float textures.")}const i=new l(t.HALF_FLOAT,r.NEAREST,o.RGBA,o.RGBA);export{l as HeatmapTextureConfiguration,i as fallBackHeatmapConfiguration,n as loadHeatmapTextureConfiguration};