PageSourceSearch

https://auramrcomp-b3pjowqc.manus.space/assets/hdrTextureLoader-CYA8LatR.js

js auramrcomp-b3pjowqc.manus.space collected 2026-10-03 05:00:10 UTC 2,430 bytes, 2 lines download raw bytes

1import"./index-0LhFotdt.js";function m(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 p(t,e,r,i,l,n){l>0?(l=m(1,l-136),t[n+0]=e*l,t[n+1]=r*l,t[n+2]=i*l):(t[n+0]=0,t[n+1]=0,t[n+2]=0)}function g(t,e){let r="",i="";for(let l=e;l<t.length-e&&(i=String.fromCharCode(t[l]),i!=`
2`);l++)r+=i;return r}function D(t){let e=0,r=0,i=g(t,0);if(i[0]!="#"||i[1]!="?")throw"Bad HDR Format.";let l=!1,n=!1,o=0;do o+=i.length+1,i=g(t,o),i=="FORMAT=32-bit_rle_rgbe"?n=!0:i.length==0&&(l=!0);while(!l);if(!n)throw"HDR Bad header format, unsupported FORMAT";o+=i.length+1,i=g(t,o);const a=/^-Y (.*) \+X (.*)$/g.exec(i);if(!a||a.length<3)throw"HDR Bad header format, no size";if(r=parseInt(a[2]),e=parseInt(a[1]),r<8||r>32767)throw"HDR Bad header format, unsupported size";return o+=i.length+1,{height:e,width:r,dataPosition:o}}function b(t,e){return H(t,e)}function H(t,e){let r=e.height;const i=e.width;let l,n,o,c,a,s=e.dataPosition,f=0,d=0,h=0;const B=new ArrayBuffer(i*4),w=new Uint8Array(B),A=new ArrayBuffer(e.width*e.height*4*3),u=new Float32Array(A);for(;r>0;){if(l=t[s++],n=t[s++],o=t[s++],c=t[s++],l!=2||n!=2||o&128||e.width<8||e.width>32767)return F(t,e);if((o<<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;f<d;)if(l=t[s++],n=t[s++],l>128){if(a=l-128,a==0||a>d-f)throw"HDR Bad Format, bad scanline data (run)";for(;a-- >0;)w[f++]=n}else{if(a=l,a==0||a>d-f)throw"HDR Bad Format, bad scanline data (non-run)";if(w[f++]=n,--a>0)for(let R=0;R<a;R++)w[f++]=t[s++]}for(h=0;h<i;h++)l=w[h],n=w[h+i],o=w[h+2*i],c=w[h+3*i],p(u,l,n,o,c,(e.height-r)*i*3+h*3);r--}return u}function F(t,e){let r=e.height;const i=e.width;let l,n,o,c,a,s=e.dataPosition;const f=new ArrayBuffer(e.width*e.height*4*3),d=new Float32Array(f);for(;r>0;){for(a=0;a<e.width;a++)l=t[s++],n=t[s++],o=t[s++],c=t[s++],p(d,l,n,o,c,(e.height-r)*i*3+a*3);r--}return d}class L{constructor(){this.supportCascades=!1}loadCubeData(){throw".hdr not supported in Cube."}loadData(e,r,i){const l=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),n=D(l),o=b(l,n),c=n.width*n.height,a=new Float32Array(c*4);for(let s=0;s<c;s+=1)a[s*4]=o[s*3],a[s*4+1]=o[s*3+1],a[s*4+2]=o[s*3+2],a[s*4+3]=1;i(n.width,n.height,r.generateMipMaps,!1,()=>{const s=r.getEngine();r.type=1,r.format=5,r._gammaSpace=!1,s._uploadDataToTextureDirectly(r,a)})}}export{L as _HDRTextureLoader};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.