/** * Cesium - https://github.com/CesiumGS/cesium * * Copyright 2011-2020 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/master/LICENSE.md for full licensing details. */ define(["./when-8d13db60","./Check-70bec281","./Math-61ede240","./Cartographic-f27b0939","./Cartesian2-09435a6c","./BoundingSphere-c409f092","./Cartesian4-5af5bb24","./RuntimeError-ba10bc3e","./WebGLConstants-4c11ee5f","./ComponentDatatype-5862616f","./PrimitiveType-97893bc7","./FeatureDetection-7bd32c34","./IndexDatatype-9435b55f","./createTaskProcessorWorker","./BoundingRectangle-3d4f3d01","./Color-69f1845f","./pako_inflate-8ea163f9","./S3MCompressType-c0bf5136"],function(t,e,n,r,a,i,E,o,s,O,y,T,p,A,_,u,pt,At){function _t(t,e,n,r,a,i){this.left=t,this.bottom=e,this.right=n,this.top=r,this.minHeight=a,this.maxHeight=i,this.width=n-t,this.length=r-e,this.height=i-a}function ut(t,e,n,r,a){var i=n.getUint32(r,!0);r+=Uint32Array.BYTES_PER_ELEMENT;var E=0,o={},s=o.vertexAttributes=[],y=o.attrLocation={};o.instanceCount=0;var T=o.instanceMode=0;n.getUint32(r,!0);r+=Uint32Array.BYTES_PER_ELEMENT;var p=n.getUint16(r,!0);r+=Uint32Array.BYTES_PER_ELEMENT;var A=p;4>8,p&=15);var _=n.getUint32(r,!0);if(r+=Uint32Array.BYTES_PER_ELEMENT,0<_){var u=n.getUint16(r,!0);u=p*Float32Array.BYTES_PER_ELEMENT,r+=Uint32Array.BYTES_PER_ELEMENT,E=_*u,y.aPosition=T,s.push({index:y.aPosition,typedArray:e.subarray(r,r+E),componentsPerAttribute:p,componentDatatype:O.ComponentDatatype.FLOAT,offsetInBytes:0,strideInBytes:u,normalize:!1}),T++,r+=E}var v=n.getUint32(r,!0);if(r+=Uint32Array.BYTES_PER_ELEMENT,0u[5]?u[4]:u[5];E={left:v,top:c,right:f,bottom:B,minHeight:m,maxHeight:l,width:(i=new _t(v,B,f,c,m,l)).width,length:i.length,height:i.height};var U=new Uint32Array(T,48+_,7),P=U[0],d=U[1],g=U[2],L=U[3];o={nFormat:P,nSideBlockCount:d,nBlockLength:g,nLength:L,nWidth:U[4],nHeight:U[5],nDepth:U[6],imageArray:new Uint8Array(T,76+_,L*L*4)}}}var N=0,M=new Uint8Array(n,0,4);if(115!==M[0]||51!==M[1]||109!==M[2])return{result:!1};var S=M[3],h=(y=new Uint8Array(n,4),pt.pako.inflate(y).buffer),R=new Uint8Array(h);e.push(R.buffer);var Y=new DataView(h),D=Y.getUint32(N,!0);N+=Uint32Array.BYTES_PER_ELEMENT;var b=new Uint8Array(h,N,D),I=D%4;I&&(I=4-I),N+=D+I;var F=At.getStringFromTypedArray(b,void 0,void 0,"gbk");F=(F=F.replace(new RegExp("\r\n","gm"),"")).replace(new RegExp(":","gm"),""),Y.getUint32(N,!0),N+=Uint32Array.BYTES_PER_ELEMENT;var x=Y.getUint32(N,!0);N+=Uint32Array.BYTES_PER_ELEMENT;var C={};C.ignoreNormal=t.ignoreNormal;for(var w=0;wAt.S3MPixelFormat.BGR||st===At.S3MPixelFormat.LUMINANCE_ALPHA?(Tt=new Uint8Array(h,N,it*Et),new Uint8Array(it*Et*4)):(Tt=new Uint16Array(h,N,X/2),new Uint16Array(it*Et)),At.DXTTextureDecode.decode(yt,it,Et,Tt,st),e.push(yt.buffer),ot=0}else yt=new Uint8Array(h,N,X);rt[at]={id:at,width:it,height:Et,compressType:ot,nFormat:st,imageBuffer:yt},N+=X}return{result:!0,version:S,xmlDoc:F,geoPackage:C,texturePackage:rt,volImageBuffer:o,volBounds:E}})});