additional_plugins/serendipity_event_osm/ressources/54.ol.js

3 lines
25 KiB
JavaScript
Raw Normal View History

2022-05-16 21:15:14 +02:00
/*! For license information please see 54.ol.js.LICENSE.txt */
(self.webpackChunkol=self.webpackChunkol||[]).push([[54],{943:function(e,r){var n,a,t,i,f,o,u,s,l,c,w,h,v;a={defaultNoDataValue:-34027999387901484e22,decode:function(e,r){var n=(r=r||{}).encodedMaskData||null===r.encodedMaskData,u=o(e,r.inputOffset||0,n),s=null!==r.noDataValue?r.noDataValue:a.defaultNoDataValue,l=t(u,r.pixelType||Float32Array,r.encodedMaskData,s,r.returnMask),c={width:u.width,height:u.height,pixelData:l.resultPixels,minValue:l.minValue,maxValue:u.pixels.maxValue,noDataValue:s};return l.resultMask&&(c.maskData=l.resultMask),r.returnEncodedMask&&u.mask&&(c.encodedMaskData=u.mask.bitset?u.mask.bitset:null),r.returnFileInfo&&(c.fileInfo=i(u),r.computeUsedBitDepths&&(c.fileInfo.bitDepths=f(u))),c}},t=function(e,r,n,a,t){var i,f,o,s=0,l=e.pixels.numBlocksX,c=e.pixels.numBlocksY,w=Math.floor(e.width/l),h=Math.floor(e.height/c),v=2*e.maxZError,y=Number.MAX_VALUE;n=n||(e.mask?e.mask.bitset:null),f=new r(e.width*e.height),t&&n&&(o=new Uint8Array(e.width*e.height));for(var d,b,k=new Float32Array(w*h),m=0;m<=c;m++){var A=m!==c?h:e.height%c;if(0!==A)for(var p=0;p<=l;p++){var U=p!==l?w:e.width%l;if(0!==U){var M,x,V,g,D=m*e.width*h+p*w,B=e.width-U,S=e.pixels.blocks[s];if(S.encoding<2?(0===S.encoding?M=S.rawData:(u(S.stuffedData,S.bitsPerPixel,S.numValidPixels,S.offset,v,k,e.pixels.maxValue),M=k),x=0):V=2===S.encoding?0:S.offset,n)for(b=0;b<A;b++){for(7&D&&(g=n[D>>3],g<<=7&D),d=0;d<U;d++)7&D||(g=n[D>>3]),128&g?(o&&(o[D]=1),y=y>(i=S.encoding<2?M[x++]:V)?i:y,f[D++]=i):(o&&(o[D]=0),f[D++]=a),g<<=1;D+=B}else if(S.encoding<2)for(b=0;b<A;b++){for(d=0;d<U;d++)y=y>(i=M[x++])?i:y,f[D++]=i;D+=B}else for(y=y>V?V:y,b=0;b<A;b++){for(d=0;d<U;d++)f[D++]=V;D+=B}if(1===S.encoding&&x!==S.numValidPixels)throw"Block and Mask do not match";s++}}}return{resultPixels:f,resultMask:o,minValue:y}},i=function(e){return{fileIdentifierString:e.fileIdentifierString,fileVersion:e.fileVersion,imageType:e.imageType,height:e.height,width:e.width,maxZError:e.maxZError,eofOffset:e.eofOffset,mask:e.mask?{numBlocksX:e.mask.numBlocksX,numBlocksY:e.mask.numBlocksY,numBytes:e.mask.numBytes,maxValue:e.mask.maxValue}:null,pixels:{numBlocksX:e.pixels.numBlocksX,numBlocksY:e.pixels.numBlocksY,numBytes:e.pixels.numBytes,maxValue:e.pixels.maxValue,noDataValue:e.noDataValue}}},f=function(e){for(var r=e.pixels.numBlocksX*e.pixels.numBlocksY,n={},a=0;a<r;a++){var t=e.pixels.blocks[a];0===t.encoding?n.float32=!0:1===t.encoding?n[t.bitsPerPixel]=!0:n[0]=!0}return Object.keys(n)},o=function(e,r,n){var a={},t=new Uint8Array(e,r,10);if(a.fileIdentifierString=String.fromCharCode.apply(null,t),"CntZImage"!==a.fileIdentifierString.trim())throw"Unexpected file identifier string: "+a.fileIdentifierString;r+=10;var i=new DataView(e,r,24);if(a.fileVersion=i.getInt32(0,!0),a.imageType=i.getInt32(4,!0),a.height=i.getUint32(8,!0),a.width=i.getUint32(12,!0),a.maxZError=i.getFloat64(16,!0),r+=24,!n)if(i=new DataView(e,r,16),a.mask={},a.mask.numBlocksY=i.getUint32(0,!0),a.mask.numBlocksX=i.getUint32(4,!0),a.mask.numBytes=i.getUint32(8,!0),a.mask.maxValue=i.getFloat32(12,!0),r+=16,a.mask.numBytes>0){var f=new Uint8Array(Math.ceil(a.width*a.height/8)),o=(i=new DataView(e,r,a.mask.numBytes)).getInt16(0,!0),u=2,s=0;do{if(o>0)for(;o--;)f[s++]=i.getUint8(u++);else{var l=i.getUint8(u++);for(o=-o;o--;)f[s++]=l}o=i.getInt16(u,!0),u+=2}while(u<a.mask.numBytes);if(-32768!==o||s<f.length)throw"Unexpected end of mask RLE encoding";a.mask.bitset=f,r+=a.mask.numBytes}else 0==(a.mask.numBytes|a.mask.numBlocksY|a.mask.maxValue)&&(a.mask.bitset=new Uint8Array(Math.ceil(a.width*a.height/8)));i=new DataView(e,r,16),a.pixels={},a.pixels.numBlocksY=i.getUint32(0,!0),a.pixels.numBlocksX=i.getUint32(4,!0),a.pixels.numBytes=i.getUint32(8,!0),a.pixels.maxValue=i.getFloat32(12,!0),r+=16;var c=a.pixels.numBlocksX,w=a.pixels.numBlocksY,h=c+(a.width%c>0?1:0),v=w+(a.height%w>0?1:0);a.pixels.blocks=new Array(h*v);for(var y=0,d=0;d<v;d++)for(var b=0;b<h;b++){var k=0,m=e.byteLength-r;i=new DataView(e,r,Math.min(10,m));var A={};a.pixels.blocks[y++]=A;var p=i.getUint8(0);if(k++,A.encoding=63&p,A.encoding>3)throw"Invalid
//# sourceMappingURL=54.ol.js.map