NuclearDispersionSystem/ant-design-vue-jeecg/public/Cesium/Workers/createVerticesFromHeightmap.js

27 lines
28 KiB
Java
Raw Normal View History

2023-09-18 11:40:16 +08:00
/**
* @license
* Cesium - https://github.com/CesiumGS/cesium
* Version 1.109
*
* Copyright 2011-2022 Cesium Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
import{a as sr,b as fr}from"./chunk-DMHOSKRF.js";import{a as tr}from"./chunk-ITS5OBIO.js";import{a as Ue}from"./chunk-NHJ7LQMB.js";import{a as ar}from"./chunk-6Z3TD6OI.js";import"./chunk-YZMLQP2E.js";import"./chunk-YTG33ZHK.js";import{a as nr}from"./chunk-LLBHZLGF.js";import"./chunk-YYMHH3T4.js";import"./chunk-ATQXFTWF.js";import{d as er,i as ir}from"./chunk-NNIY7VTE.js";import"./chunk-NX64RCXJ.js";import{b as xe,c as ae,d as rr}from"./chunk-5EDTRNG5.js";import"./chunk-IO6LETQ6.js";import{a as ie,c as Ie}from"./chunk-C6Y3PRDH.js";import{a as ge}from"./chunk-LI57NJAL.js";import"./chunk-IBAO62UG.js";import{a as He}from"./chunk-3NARV6MR.js";import{a as Y}from"./chunk-P44SUSQU.js";import{a as he}from"./chunk-FUATUYJ3.js";import{c as Ir,d as xr,e as G}from"./chunk-ODUTJJQ5.js";var ur=Ir((qr,Te)=>{/* Copyright 2015-2018 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */(function(){var D=function(){var A={};A.defaultNoDataValue=-34027999387901484e22,A.decode=function(r,a){a=a||{};var t=a.encodedMaskData||a.encodedMaskData===null,i=n(r,a.inputOffset||0,t),o=a.noDataValue!==null?a.noDataValue:A.defaultNoDataValue,s=V(i,a.pixelType||Float32Array,a.encodedMaskData,o,a.returnMask),u={width:i.width,height:i.height,pixelData:s.resultPixels,minValue:s.minValue,maxValue:i.pixels.maxValue,noDataValue:o};return s.resultMask&&(u.maskData=s.resultMask),a.returnEncodedMask&&i.mask&&(u.encodedMaskData=i.mask.bitset?i.mask.bitset:null),a.returnFileInfo&&(u.fileInfo=b(i),a.computeUsedBitDepths&&(u.fileInfo.bitDepths=X(i))),u};var V=function(r,a,t,i,o){var s=0,u=r.pixels.numBlocksX,m=r.pixels.numBlocksY,l=Math.floor(r.width/u),f=Math.floor(r.height/m),h=2*r.maxZError,c=Number.MAX_VALUE,g;t=t||(r.mask?r.mask.bitset:null);var v,U;v=new a(r.width*r.height),o&&t&&(U=new Uint8Array(r.width*r.height));for(var M=new Float32Array(l*f),S,I,k=0;k<=m;k++){var w=k!==m?f:r.height%m;if(w!==0)for(var d=0;d<=u;d++){var x=d!==u?l:r.width%u;if(x!==0){var T=k*r.width*f+d*l,y=r.width-x,p=r.pixels.blocks[s],L,B,E;p.encoding<2?(p.encoding===0?L=p.rawData:(e(p.stuffedData,p.bitsPerPixel,p.numValidPixels,p.offset,h,M,r.pixels.maxValue),L=M),B=0):p.encoding===2?E=0:E=p.offset;var O;if(t)for(I=0;I<w;I++){for(T&7&&(O=t[T>>3],O<<=T&7),S=0;S<x;S++)T&7||(O=t[T>>3]),O&128?(U&&(U[T]=1),g=p.encoding<2?L[B++]:E,c=c>g?g:c,v[T++]=g):(U&&(U[T]=0),v[T++]=i),O<<=1;T+=y}else if(p.encoding<2)for(I=0;I<w;I++){for(S=0;S<x;S++)g=L[B++],c=c>g?g:c,v[T++]=g;T+=y}else for(c=c>E?E:c,I=0;I<w;I++){for(S=0;S<x;S++)v[T++]=E;T+=y}if(p.encoding===1&&B!==p.numValidPixels)throw"Block and Mask do not match";s++}}}return{resultPixels:v,resultMask:U,minValue:c}},b=function(r){return{fileIdentifierString:r.fileIdentifierString,fileVersion:r.fileVersion,imageType:r.imageType,height:r.height,width:r.width,maxZError:r.maxZError,eofOffset:r.eofOffset,mask:r.mask?{numBlocksX:r.mask.numBlocksX,numBlocksY:r.mask.numBlocksY,numBytes:r.mask.numBytes,maxValue:r.mask.maxValue}:null,pixels:{numBlocksX:r.pixels.numBlocksX,numBlocksY:r.pixels.numBlocksY,numBytes:r.pixels.numBytes,maxValue:r.pixels.maxValue,noDataValue:r.noDataValue}}},X=function(r){for(var a=r.pixels.numBlocksX*r.pixels.numBlocksY,t={},i=0;i<a;i++){var o=r.pixels.blocks[i];o.encoding===0?t.float32=!0:o.encoding===1?t[o.bitsPerPixel]=!0:t[0]=!0}return Object.keys(t)},n=function(r,a,t){var i={},o=new Uint8Array(r,a,10);if(i.fileIdentifierString=String.fromCharCode.apply(null,o),i.fileIdentifierString.trim()!=="CntZImage")throw"Unexpected file identifier string: "+i.fileIdentifierString;a+=10;var s=new DataView(r,a,24);if(i.fileVersion=s.getInt32(0,!0),i.imageType=s.getInt32(4,!0),i.height=s.getUint32(8,!0),i.width=s.getUint32(12,!0),i.maxZError=s.getFloat64(16,!0),a+=24,!t)if(s=new DataView(r,a,16),i.mask={},i.mask.numBlocksY=s.getUint32(0,!0),i.mask.numBlocksX=s.getUint32(4,!0),i.mask.numBytes=s.getUint32(8,!0),i.mask.maxValue=s.getFloat32(12,!0),a+=16,i.mask.numBytes>0){var