/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import e from"../../core/Error.js";import{PixelType as t,SizedPixelFormat as r}from"./enums.js";class o{constructor(e,t,r,o){this.dataType=e,this.samplingMode=t,this.pixelFormat=r,this.internalFormat=o}}function a(a,l){const{textureFloatLinear:n,colorBufferFloat:i}=a.capabilities,s=i?.textureFloat,f=i?.textureHalfFloat,u=i?.floatBlend,_=a.driverTest.floatBufferBlend.result;if(!s&&!f)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(!(u&&_||f))throw new e("heatmap:missing-float-blend","HeatmapRenderer requires the WebGL extension EXT_float_blend or EXT_color_buffer_half_float."+(_?"":" This device claims support for EXT_float_blend, but does not actually support it."));const c=s&&u&&_,m=f,p=n,d=!!i?.R32F,h=!!i?.R16F;if(c&&p)return p||l.warnOnce("Missing WebGL extension OES_texture_float_linear. Heatmap quality may be reduced."),new o(t.FLOAT,p?9729:9728,d?6403:6408,d?r.R32F:6408);if(m)return new o(t.HALF_FLOAT,9729,h?6403:6408,h?r.R16F:6408);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 l=new o(t.HALF_FLOAT,9728,6408,6408);export{o as HeatmapTextureConfiguration,l as fallBackHeatmapConfiguration,a as loadHeatmapTextureConfiguration};
