SourceTermAnalysisSystem_vue/node_modules/geotiff/dist-browser/geotiff.js

5 lines
310 KiB
JavaScript
Raw Normal View History

2026-05-15 10:22:44 +08:00
!function(A,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((A="undefined"!=typeof globalThis?globalThis:A||self).GeoTIFF={})}(this,(function(A){"use strict";function e(A,e,t){return e in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function t(A){if(Array.isArray(A))return A}function r(A,e){(null==e||e>A.length)&&(e=A.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=A[t];return r}function n(A,e){if(A){if("string"==typeof A)return r(A,e);var t=Object.prototype.toString.call(A).slice(8,-1);return"Object"===t&&A.constructor&&(t=A.constructor.name),"Map"===t||"Set"===t?Array.from(A):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?r(A,e):void 0}}function i(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(A,e){return t(A)||function(A,e){var t=null==A?null:"undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(null!=t){var r,n,i=[],a=!0,o=!1;try{for(t=t.call(A);!(a=(r=t.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(A){o=!0,n=A}finally{try{a||null==t.return||t.return()}finally{if(o)throw n}}return i}}(A,e)||n(A,e)||i()}function o(A,e,t,r,n,i,a){try{var o=A[i](a),g=o.value}catch(A){return void t(A)}o.done?e(g):Promise.resolve(g).then(r,n)}function g(A){return function(){var e=this,t=arguments;return new Promise((function(r,n){var i=A.apply(e,t);function a(A){o(i,r,n,a,g,"next",A)}function g(A){o(i,r,n,a,g,"throw",A)}a(void 0)}))}}function I(A,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(A,r.key,r)}}function s(A,e,t){return e&&I(A.prototype,e),t&&I(A,t),A}function B(A,e){return B=Object.setPrototypeOf||function(A,e){return A.__proto__=e,A},B(A,e)}function c(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),e&&B(A,e)}function f(A){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},f(A)}function C(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function u(A,e){if(e&&("object"===f(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return C(A)}function Q(A){return Q=Object.setPrototypeOf?Object.getPrototypeOf:function(A){return A.__proto__||Object.getPrototypeOf(A)},Q(A)}function E(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(A){return!1}}function l(A,e,t){return l=E()?Reflect.construct:function(A,e,t){var r=[null];r.push.apply(r,e);var n=new(Function.bind.apply(A,r));return t&&B(n,t.prototype),n},l.apply(null,arguments)}function h(A){var e="function"==typeof Map?new Map:void 0;return h=function(A){if(null===A||(t=A,-1===Function.toString.call(t).indexOf("[native code]")))return A;var t;if("function"!=typeof A)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(A))return e.get(A);e.set(A,r)}function r(){return l(A,arguments,Q(this).constructor)}return r.prototype=Object.create(A.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),B(r,A)},h(A)}function d(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}var w={exports:{}};!function(A){var e=function(A){var e,t=Object.prototype,r=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",a=n.asyncIterator||"@@asyncIterator",o=n.toStringTag||
/* Copyright 2015-2021 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 e,t,r,n,i,a,o,g,I=(e={defaultNoDataValue:-34027999387901484e22,decode:function(A,a){var o=(a=a||{}).encodedMaskData||null===a.encodedMaskData,g=i(A,a.inputOffset||0,o),I=null!==a.noDataValue?a.noDataValue:e.defaultNoDataValue,s=t(g,a.pixelType||Float32Array,a.encodedMaskData,I,a.returnMask),B={width:g.width,height:g.height,pixelData:s.resultPixels,minValue:s.minValue,maxValue:g.pixels.maxValue,noDataValue:I};return s.resultMask&&(B.maskData=s.resultMask),a.returnEncodedMask&&g.mask&&(B.encodedMaskData=g.mask.bitset?g.mask.bitset:null),a.returnFileInfo&&(B.fileInfo=r(g),a.computeUsedBitDepths&&(B.fileInfo.bitDepths=n(g))),B}},t=function(A,e,t,r,n){var i,o,g,I=0,s=A.pixels.numBlocksX,B=A.pixels.numBlocksY,c=Math.floor(A.width/s),f=Math.floor(A.height/B),C=2*A.maxZError,u=Number.MAX_VALUE;t=t||(A.mask?A.mask.bitset:null),o=new e(A.width*A.height),n&&t&&(g=new Uint8Array(A.width*A.height));for(var Q,E,l=new Float32Array(c*f),h=0;h<=B;h++){var d=h!==B?f:A.height%B;if(0!==d)for(var w=0;w<=s;w++){var y=w!==s?c:A.width%s;if(0!==y){var p,D,k,m,v=h*A.width*f+w*c,b=A.width-y,G=A.pixels.blocks[I];if(G.encoding<2?(0===G.encoding?p=G.rawData:(a(G.stuffedData,G.bitsPerPixel,G.numValidPixels,G.offset,C,l,A.pixels.maxValue),p=l),D=0):k=2===G.encoding?0:G.offset,t)for(E=0;E<d;E++){for(7&v&&(m=t[v>>3],m<<=7&v),Q=0;Q<y;Q++)7&v||(m=t[v>>3]),128&m?(g&&(g[v]=1),u=u>(i=G.encoding<2?p[D++]:k)?i:u,o[v++]=i):(g&&(g[v]=0),o[v++]=r),m<<=1;v+=b}else if(G.encoding<2)for(E=0;E<d;E++){for(Q=0;Q<y;Q++)u=u>(i=p[D++])?i:u,o[v++]=i;v+=b}else for(u=u>k?k:u,E=0;E<d;E++){for(Q=0;Q<y;Q++)o[v++]=k;v+=b}if(1===G.encoding&&D!==G.numValidPixels)throw"Block and Mask do not match";I++}}}return{resultPixels:o,resultMask:g,minValue:u}},r=function(A){return{fileIdentifierString:A.fileIdentifierString,fileVersion:A.fileVersion,imageType:A.imageType,height:A.height,width:A.width,maxZError:A.maxZError,eofOffset:A.eofOffset,mask:A.mask?{numBlocksX:A.mask.numBlocksX,numBlocksY:A.mask.numBlocksY,numBytes:A.mask.numBytes,maxValue:A.mask.maxValue}:null,pixels:{numBlocksX:A.pixels.numBlocksX,numBlocksY:A.pixels.numBlocksY,numBytes:A.pixels.numBytes,maxValue:A.pixels.maxValue,noDataValue:A.noDataValue}}},n=function(A){for(var e=A.pixels.numBlocksX*A.pixels.numBlocksY,t={},r=0;r<e;r++){var n=A.pixels.blocks[r];0===n.encoding?t.float32=!0:1===n.encoding?t[n.bitsPerPixel]=!0:t[0]=!0}return Object.keys(t)},i=function(A,e,t){var r={},n=new Uint8Array(A,e,10);if(r.fileIdentifierString=String.fromCharCode.apply(null,n),"CntZImage"!==r.fileIdentifierString.trim())throw"Unexpected file identifier string: "+r.fileIdentifierString;e+=10;var i=new DataView(A,e,24);if(r.fileVersion=i.getInt32(0,!0),r.imageType=i.getInt32(4,!0),r.height=i.getUint32(8,!0),r.width=i.getUint32(12,!0),r.maxZError=i.getFloat64(16,!0),e+=24,!t)if(i=new DataView(A,e,16),r.mask={},r.mask.numBlocksY=i.getUint32(0,!0),r.mask.numBlocksX=i.getUint32(4,!0),r.mask.numBytes=i.getUint32(8,!0),r.mask.maxValue=i.getFloat32(12,!0),e+=16,r.mask.numBytes>0){var a=new Uint8Array(Math.ceil(r.width*r.height/8)),o=(i=new DataView(A,e,r.mask.numBytes)).getInt16(0,!0),g=2,I=0;do{if(o>0)for(;o--;)a[I++]=i.getUint8(g++);else{var s=i.getUint8(g++);for(o=-o;o--;)a[I++]=s}o=i.getInt16(g,!0),g+=2}while(g<r.mask.numBytes);if(-32768!==o||I<a.length)throw"Unexpected end of mask RLE encoding";r.mask.bitset=a,e+=r.mask.numBytes}else 0==(r.mask.numBytes|r.mask.numBlocksY|r.mask.maxValue)&&(r.mask.bitset=new Uint8Array(Math.ceil(r.width*r.height/8)));i=new DataView(A,e,16),r.pixels={},r.pixels.numBlocksY=i.getUint32(0,!0),r.pixels.numBlocksX=i.getUint32(4,!0),r.pixels.numBytes=i.getUint32(8,!0),r.pixels.maxValue=i.getFloat32(12,!0),e+=16;var B=r.pixels.numBlocksX,c=r.pixels.numBlocksY,f=B+(r.width%B>0?1:0),C=c+(r.height%c>0?1:0);r.pixels.blocks=new Array(f*C);for(var u=0,Q=0;Q<C;Q++)for(var E=0;E<f;E++){var l=0,h=A.byteLength-e;i=new DataView(A,e,Math.min(10,h));var d={};r.pixels.blocks[u++]=d;var w=i.getUint8(0);if(l++,d.encoding=63&w,d.encoding>3)throw"Invalid block encoding ("+d.encoding+")";if(2!==d.encoding){if(0!==w&&2!==w){if
//# sourceMappingURL=geotiff.js.map