import"./Viewer-DVCEMRp5.js";import"./vuetify-Ce4WN_Dg.js";import"./overlayscrollbars-CiKU261J.js";import"./index-Bku7SJna.js";import"./echarts-DzoUeqWp.js";import"./codemirror-ZSHHXwGs.js";function A(t,e){return e>1023?t*Math.pow(2,1023)*Math.pow(2,e-1023):e<-1074?t*Math.pow(2,-1074)*Math.pow(2,e+1074):t*Math.pow(2,e)}function R(t,e,a,i,r,l){r>0?(r=A(1,r-136),t[l+0]=e*r,t[l+1]=a*r,t[l+2]=i*r):(t[l+0]=0,t[l+1]=0,t[l+2]=0)}function g(t,e){let a="",i="";for(let r=e;r32767)throw"HDR Bad header format, unsupported size";return s+=i.length+1,{height:e,width:a,dataPosition:s}}function b(t,e){return _(t,e)}function _(t,e){let a=e.height;const i=e.width;let r,l,s,c,n,o=e.dataPosition,f=0,d=0,h=0;const m=new ArrayBuffer(i*4),w=new Uint8Array(m),B=new ArrayBuffer(e.width*e.height*4*3),u=new Float32Array(B);for(;a>0;){if(r=t[o++],l=t[o++],s=t[o++],c=t[o++],r!=2||l!=2||s&128||e.width<8||e.width>32767)return H(t,e);if((s<<8|c)!=i)throw"HDR Bad header format, wrong scan line width";for(f=0,h=0;h<4;h++)for(d=(h+1)*i;f128){if(n=r-128,n==0||n>d-f)throw"HDR Bad Format, bad scanline data (run)";for(;n-- >0;)w[f++]=l}else{if(n=r,n==0||n>d-f)throw"HDR Bad Format, bad scanline data (non-run)";if(w[f++]=l,--n>0)for(let p=0;p0;){for(n=0;n{const o=a.getEngine();a.type=1,a.format=5,a._gammaSpace=!1,o._uploadDataToTextureDirectly(a,n)})}}export{C as _HDRTextureLoader};