@vcmap/ui 5.0.0-rc.9 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (724) hide show
  1. package/README.md +90 -106
  2. package/app.config.json +3 -0
  3. package/build/.eslintrc +3 -0
  4. package/build/build.js +302 -162
  5. package/build/buildCesium.js +39 -19
  6. package/build/buildHelpers.js +279 -87
  7. package/build/buildPreview.js +16 -6
  8. package/build/bundle.js +57 -0
  9. package/build/commonViteConfig.js +6 -15
  10. package/build/determineHost.js +17 -4
  11. package/build/generateOLLib.js +15 -18
  12. package/build/getPluginProxies.js +35 -3
  13. package/build/info/conf.json +21 -19
  14. package/build/info/publish.js +16 -5
  15. package/config/aerowest.config.json +47 -54
  16. package/config/base.config.json +597 -662
  17. package/config/codes.config.json +401 -0
  18. package/config/dev.config.json +460 -14
  19. package/config/graphFeatureInfo.config.json +141 -0
  20. package/config/projects.config.json +29 -0
  21. package/config/www.config.json +1801 -0
  22. package/dist/assets/@mdi/font/LICENSE +20 -0
  23. package/dist/assets/@mdi/font/css/materialdesignicons.css.map +16 -0
  24. package/dist/assets/@mdi/font/css/materialdesignicons.min.e3f476.css +3 -0
  25. package/dist/assets/@mdi/font/fonts/materialdesignicons-webfont.woff2 +0 -0
  26. package/dist/assets/cesium/ThirdParty/Workers/basis_transcoder.js +21 -0
  27. package/dist/assets/cesium/ThirdParty/Workers/package.json +1 -0
  28. package/dist/assets/cesium/ThirdParty/Workers/pako_deflate.min.js +2 -0
  29. package/dist/assets/cesium/ThirdParty/Workers/pako_inflate.min.js +2 -0
  30. package/dist/assets/cesium/ThirdParty/Workers/z-worker-pako.js +1 -0
  31. package/dist/assets/cesium/ThirdParty/basis_transcoder.wasm +0 -0
  32. package/dist/assets/cesium/ThirdParty/draco_decoder.wasm +0 -0
  33. package/dist/assets/cesium/ThirdParty/google-earth-dbroot-parser.js +8337 -0
  34. package/dist/assets/cesium/Workers/chunk-227AJNOA.js +59 -0
  35. package/dist/assets/cesium/Workers/chunk-2R5O53JW.js +157 -0
  36. package/dist/assets/cesium/Workers/chunk-34YUDLRP.js +781 -0
  37. package/dist/assets/cesium/Workers/chunk-3W63OHNJ.js +100 -0
  38. package/dist/assets/cesium/Workers/chunk-4MFFIWUA.js +163 -0
  39. package/dist/assets/cesium/Workers/chunk-66QLLS45.js +218 -0
  40. package/dist/assets/cesium/Workers/chunk-6BTKZDRG.js +77 -0
  41. package/dist/assets/cesium/Workers/chunk-A4JVFBQ3.js +101 -0
  42. package/dist/assets/cesium/Workers/chunk-ABADGKYE.js +58 -0
  43. package/dist/assets/cesium/Workers/chunk-AFFLIKOH.js +353 -0
  44. package/dist/assets/cesium/Workers/chunk-AHKEZ2OE.js +629 -0
  45. package/dist/assets/cesium/Workers/chunk-C3SXRKRW.js +476 -0
  46. package/dist/assets/cesium/Workers/chunk-CCFQRR6D.js +55 -0
  47. package/dist/assets/cesium/Workers/chunk-CHHNOC2C.js +1860 -0
  48. package/dist/assets/cesium/Workers/chunk-CTELOFLA.js +196 -0
  49. package/dist/assets/cesium/Workers/chunk-DUHWWBQQ.js +3273 -0
  50. package/dist/assets/cesium/Workers/chunk-EW2GWJYB.js +44 -0
  51. package/dist/assets/cesium/Workers/chunk-GLZBE3ML.js +421 -0
  52. package/dist/assets/cesium/Workers/chunk-HARLBUOL.js +236 -0
  53. package/dist/assets/cesium/Workers/chunk-HQF437NJ.js +117 -0
  54. package/dist/assets/cesium/Workers/chunk-IPA4EACJ.js +368 -0
  55. package/dist/assets/cesium/Workers/chunk-J3JY6I2C.js +1009 -0
  56. package/dist/assets/cesium/Workers/chunk-JB2LWGH4.js +390 -0
  57. package/dist/assets/cesium/Workers/chunk-JS3AW5BK.js +634 -0
  58. package/dist/assets/cesium/Workers/chunk-K36FEYS7.js +452 -0
  59. package/dist/assets/cesium/Workers/chunk-KD4Y7CZL.js +400 -0
  60. package/dist/assets/cesium/Workers/chunk-KTJSNCK4.js +842 -0
  61. package/dist/assets/cesium/Workers/chunk-LLUNNUJV.js +258 -0
  62. package/dist/assets/cesium/Workers/chunk-MPAZH4BF.js +37 -0
  63. package/dist/assets/cesium/Workers/chunk-MYZB7C4T.js +1258 -0
  64. package/dist/assets/cesium/Workers/chunk-N3JIFFX2.js +501 -0
  65. package/dist/assets/cesium/Workers/chunk-O5AMBQ36.js +430 -0
  66. package/dist/assets/cesium/Workers/chunk-OAVNIRB4.js +124 -0
  67. package/dist/assets/cesium/Workers/chunk-OYFCF4PL.js +171 -0
  68. package/dist/assets/cesium/Workers/chunk-OZJDGN5F.js +1477 -0
  69. package/dist/assets/cesium/Workers/chunk-PCJWUS4M.js +2041 -0
  70. package/dist/assets/cesium/Workers/chunk-PFQBCKBM.js +8644 -0
  71. package/dist/assets/cesium/Workers/chunk-QIKODV5G.js +305 -0
  72. package/dist/assets/cesium/Workers/chunk-QJ3DFBH3.js +73 -0
  73. package/dist/assets/cesium/Workers/chunk-QMEMZIJI.js +138 -0
  74. package/dist/assets/cesium/Workers/chunk-QT3MPEMI.js +102 -0
  75. package/dist/assets/cesium/Workers/chunk-RP2A7BR5.js +289 -0
  76. package/dist/assets/cesium/Workers/chunk-RW6LU2CJ.js +138 -0
  77. package/dist/assets/cesium/Workers/chunk-TFC6TZ3S.js +757 -0
  78. package/dist/assets/cesium/Workers/chunk-V3NGATMV.js +693 -0
  79. package/dist/assets/cesium/Workers/chunk-VLGOATD6.js +1075 -0
  80. package/dist/assets/cesium/Workers/chunk-WXTV4ATB.js +39 -0
  81. package/dist/assets/cesium/Workers/chunk-X4SU25DT.js +302 -0
  82. package/dist/assets/cesium/Workers/chunk-XTY7B2N6.js +2716 -0
  83. package/dist/assets/cesium/Workers/chunk-XY7MGBKC.js +513 -0
  84. package/dist/assets/cesium/Workers/chunk-Z24VKNDO.js +834 -0
  85. package/dist/assets/cesium/Workers/chunk-ZA25DG4Y.js +684 -0
  86. package/dist/assets/cesium/Workers/chunk-ZFOBYDGF.js +73 -0
  87. package/dist/assets/cesium/Workers/combineGeometry.js +67 -1
  88. package/dist/assets/cesium/Workers/createBoxGeometry.js +57 -1
  89. package/dist/assets/cesium/Workers/createBoxOutlineGeometry.js +234 -1
  90. package/dist/assets/cesium/Workers/createCircleGeometry.js +196 -1
  91. package/dist/assets/cesium/Workers/createCircleOutlineGeometry.js +146 -1
  92. package/dist/assets/cesium/Workers/createCoplanarPolygonGeometry.js +506 -1
  93. package/dist/assets/cesium/Workers/createCoplanarPolygonOutlineGeometry.js +224 -1
  94. package/dist/assets/cesium/Workers/createCorridorGeometry.js +1262 -1
  95. package/dist/assets/cesium/Workers/createCorridorOutlineGeometry.js +567 -1
  96. package/dist/assets/cesium/Workers/createCylinderGeometry.js +59 -1
  97. package/dist/assets/cesium/Workers/createCylinderOutlineGeometry.js +231 -1
  98. package/dist/assets/cesium/Workers/createEllipseGeometry.js +70 -1
  99. package/dist/assets/cesium/Workers/createEllipseOutlineGeometry.js +63 -1
  100. package/dist/assets/cesium/Workers/createEllipsoidGeometry.js +58 -1
  101. package/dist/assets/cesium/Workers/createEllipsoidOutlineGeometry.js +60 -1
  102. package/dist/assets/cesium/Workers/createFrustumGeometry.js +57 -1
  103. package/dist/assets/cesium/Workers/createFrustumOutlineGeometry.js +234 -1
  104. package/dist/assets/cesium/Workers/createGeometry.js +150 -1
  105. package/dist/assets/cesium/Workers/createGroundPolylineGeometry.js +1607 -1
  106. package/dist/assets/cesium/Workers/createPlaneGeometry.js +223 -1
  107. package/dist/assets/cesium/Workers/createPlaneOutlineGeometry.js +123 -1
  108. package/dist/assets/cesium/Workers/createPolygonGeometry.js +1134 -1
  109. package/dist/assets/cesium/Workers/createPolygonOutlineGeometry.js +542 -1
  110. package/dist/assets/cesium/Workers/createPolylineGeometry.js +495 -1
  111. package/dist/assets/cesium/Workers/createPolylineVolumeGeometry.js +379 -1
  112. package/dist/assets/cesium/Workers/createPolylineVolumeOutlineGeometry.js +277 -1
  113. package/dist/assets/cesium/Workers/createRectangleGeometry.js +1273 -1
  114. package/dist/assets/cesium/Workers/createRectangleOutlineGeometry.js +480 -1
  115. package/dist/assets/cesium/Workers/createSimplePolylineGeometry.js +399 -1
  116. package/dist/assets/cesium/Workers/createSphereGeometry.js +117 -1
  117. package/dist/assets/cesium/Workers/createSphereOutlineGeometry.js +117 -1
  118. package/dist/assets/cesium/Workers/createTaskProcessorWorker.js +32 -1
  119. package/dist/assets/cesium/Workers/createVectorTileClampedPolylines.js +492 -1
  120. package/dist/assets/cesium/Workers/createVectorTileGeometries.js +386 -1
  121. package/dist/assets/cesium/Workers/createVectorTilePoints.js +112 -1
  122. package/dist/assets/cesium/Workers/createVectorTilePolygons.js +384 -1
  123. package/dist/assets/cesium/Workers/createVectorTilePolylines.js +262 -1
  124. package/dist/assets/cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +568 -1
  125. package/dist/assets/cesium/Workers/createVerticesFromHeightmap.js +2277 -3
  126. package/dist/assets/cesium/Workers/createVerticesFromQuantizedTerrainMesh.js +745 -1
  127. package/dist/assets/cesium/Workers/createWallGeometry.js +489 -1
  128. package/dist/assets/cesium/Workers/createWallOutlineGeometry.js +337 -1
  129. package/dist/assets/cesium/Workers/decodeDraco.js +369 -1
  130. package/dist/assets/cesium/Workers/decodeGoogleEarthEnterprisePacket.js +2650 -1
  131. package/dist/assets/cesium/Workers/decodeI3S.js +835 -0
  132. package/dist/assets/cesium/Workers/transcodeKTX2.js +3425 -1
  133. package/dist/assets/cesium/Workers/transferTypedArrayTest.js +41 -1
  134. package/dist/assets/cesium/Workers/upsampleQuantizedTerrainMesh.js +818 -1
  135. package/dist/assets/cesium.4137c8.js +164897 -0
  136. package/dist/assets/cesium.js +1 -1
  137. package/dist/assets/core.306872.js +19286 -0
  138. package/dist/assets/core.js +1 -1
  139. package/dist/assets/favicon-128.4c4ce5.png +0 -0
  140. package/dist/assets/favicon-180.5b99c0.png +0 -0
  141. package/dist/assets/favicon-192.0e205e.png +0 -0
  142. package/dist/assets/favicon-32.6b9add.png +0 -0
  143. package/dist/assets/favicon.d5ec97.svg +10 -0
  144. package/dist/assets/font/OFL.txt +93 -0
  145. package/dist/assets/font/TitilliumWeb-Regular.9ca076.woff2 +0 -0
  146. package/dist/assets/index-cfed33b1.js +1 -0
  147. package/dist/assets/ol.328bbf.js +60117 -0
  148. package/dist/assets/ol.js +1 -1
  149. package/dist/assets/style/icon-marker-blue.534e37.png +0 -0
  150. package/dist/assets/style/icon-marker-green.0b6a92.png +0 -0
  151. package/dist/assets/style/icon-marker-o-blue.7b6d62.png +0 -0
  152. package/dist/assets/style/icon-marker-o-green.c863c0.png +0 -0
  153. package/dist/assets/style/icon-marker-o-red.93ff58.png +0 -0
  154. package/dist/assets/style/icon-marker-o.036477.png +0 -0
  155. package/dist/assets/style/icon-marker-red.313d03.png +0 -0
  156. package/dist/assets/style/icon-marker.70960f.png +0 -0
  157. package/dist/assets/style/icon-pin-blue.7be369.png +0 -0
  158. package/dist/assets/style/icon-pin-green.cbb935.png +0 -0
  159. package/dist/assets/style/icon-pin-red.3f25b2.png +0 -0
  160. package/dist/assets/style/icon-pin.b7ce77.png +0 -0
  161. package/dist/assets/ui.e84ce9.css +5 -0
  162. package/dist/assets/ui.e84ce9.js +16488 -0
  163. package/dist/assets/ui.js +1 -1
  164. package/dist/assets/vue.1c8696.js +4911 -0
  165. package/dist/assets/vue.js +5 -1
  166. package/dist/assets/vuetify.008fac.css +5 -0
  167. package/dist/assets/vuetify.008fac.js +21262 -0
  168. package/dist/assets/vuetify.js +5 -2
  169. package/dist/index.html +90 -8
  170. package/index.html +111 -0
  171. package/index.js +171 -24
  172. package/lib/cesium.js +1 -1
  173. package/lib/core.js +1 -1
  174. package/lib/olLib.js +861 -843
  175. package/lib/ui.js +1 -1
  176. package/lib/vue.js +2 -1
  177. package/lib/vuetify.js +2 -2
  178. package/package.json +53 -33
  179. package/plugins/.eslintrc +9 -0
  180. package/plugins/@vcmap-show-case/README.md +28 -0
  181. package/plugins/@vcmap-show-case/buttons-example/README.md +4 -0
  182. package/plugins/@vcmap-show-case/buttons-example/package.json +5 -0
  183. package/plugins/@vcmap-show-case/buttons-example/src/ButtonsExample.vue +282 -0
  184. package/plugins/@vcmap-show-case/buttons-example/src/index.js +51 -0
  185. package/plugins/@vcmap-show-case/category-tester/README.md +3 -0
  186. package/plugins/@vcmap-show-case/category-tester/package.json +5 -0
  187. package/plugins/@vcmap-show-case/category-tester/src/CategoriesExample.vue +135 -0
  188. package/plugins/@vcmap-show-case/category-tester/src/CollectionComponentOptions.vue +209 -0
  189. package/plugins/@vcmap-show-case/category-tester/src/index.js +73 -0
  190. package/plugins/@vcmap-show-case/collection-manager-example/README.md +3 -0
  191. package/plugins/@vcmap-show-case/collection-manager-example/package.json +5 -0
  192. package/plugins/@vcmap-show-case/collection-manager-example/src/CollectionManagerExample.vue +182 -0
  193. package/plugins/@vcmap-show-case/collection-manager-example/src/index.js +79 -0
  194. package/plugins/@vcmap-show-case/config-editor/README.md +3 -0
  195. package/plugins/@vcmap-show-case/config-editor/package.json +5 -0
  196. package/plugins/@vcmap-show-case/config-editor/src/ConfigEditor.vue +62 -0
  197. package/plugins/@vcmap-show-case/config-editor/src/index.js +49 -0
  198. package/plugins/@vcmap-show-case/context-menu-tester/README.md +3 -0
  199. package/plugins/@vcmap-show-case/context-menu-tester/package.json +5 -0
  200. package/plugins/@vcmap-show-case/context-menu-tester/src/index.js +41 -0
  201. package/plugins/@vcmap-show-case/form-inputs-example/README.md +4 -0
  202. package/plugins/@vcmap-show-case/form-inputs-example/config.json +5 -0
  203. package/plugins/@vcmap-show-case/form-inputs-example/package.json +5 -0
  204. package/plugins/@vcmap-show-case/form-inputs-example/src/FormInputsExample.vue +516 -0
  205. package/plugins/@vcmap-show-case/form-inputs-example/src/exampleActions.js +36 -0
  206. package/plugins/{@vcmap/pluginExample → @vcmap-show-case/form-inputs-example/src}/index.js +119 -35
  207. package/plugins/{@vcmap/pluginExample → @vcmap-show-case/form-inputs-example/src}/validation.js +14 -2
  208. package/plugins/@vcmap-show-case/hello-world/README.md +31 -0
  209. package/plugins/@vcmap-show-case/hello-world/package.json +6 -0
  210. package/plugins/@vcmap-show-case/hello-world/plugin-assets/vcs_logo.png +0 -0
  211. package/plugins/@vcmap-show-case/hello-world/src/defaultOptions.js +4 -0
  212. package/plugins/@vcmap-show-case/hello-world/src/helloWorld.vue +69 -0
  213. package/plugins/@vcmap-show-case/hello-world/src/index.js +142 -0
  214. package/plugins/@vcmap-show-case/hello-world/tests/helloWorld.spec.js +53 -0
  215. package/plugins/@vcmap-show-case/icons-example/README.md +5 -0
  216. package/plugins/@vcmap-show-case/icons-example/package.json +5 -0
  217. package/plugins/@vcmap-show-case/icons-example/src/AllIconsComponent.vue +51 -0
  218. package/plugins/@vcmap-show-case/icons-example/src/index.js +46 -0
  219. package/plugins/@vcmap-show-case/list-example/README.md +3 -0
  220. package/plugins/@vcmap-show-case/list-example/package.json +5 -0
  221. package/plugins/@vcmap-show-case/list-example/src/ListExample.vue +411 -0
  222. package/plugins/@vcmap-show-case/list-example/src/index.js +46 -0
  223. package/plugins/@vcmap-show-case/notifier-tester/README.md +3 -0
  224. package/plugins/@vcmap-show-case/notifier-tester/package.json +5 -0
  225. package/plugins/@vcmap-show-case/notifier-tester/src/NotifierTester.vue +82 -0
  226. package/plugins/@vcmap-show-case/notifier-tester/src/index.js +42 -0
  227. package/plugins/@vcmap-show-case/plugin-editors/README.md +4 -0
  228. package/plugins/@vcmap-show-case/plugin-editors/package.json +5 -0
  229. package/plugins/@vcmap-show-case/plugin-editors/src/PluginEditors.vue +119 -0
  230. package/plugins/@vcmap-show-case/plugin-editors/src/index.js +41 -0
  231. package/plugins/@vcmap-show-case/project-selector/README.md +25 -0
  232. package/plugins/@vcmap-show-case/project-selector/config.json +15 -0
  233. package/plugins/{@vcmap → @vcmap-show-case}/project-selector/package.json +3 -4
  234. package/plugins/{@vcmap/project-selector/ContextsListComponent.vue → @vcmap-show-case/project-selector/src/ModulesListComponent.vue} +22 -19
  235. package/plugins/@vcmap-show-case/project-selector/src/ProjectSelectorComponent.vue +102 -0
  236. package/plugins/@vcmap-show-case/project-selector/src/de.json +10 -0
  237. package/plugins/@vcmap-show-case/project-selector/src/en.json +10 -0
  238. package/plugins/@vcmap-show-case/project-selector/src/index.js +269 -0
  239. package/plugins/@vcmap-show-case/simple-graph/README.md +71 -0
  240. package/plugins/@vcmap-show-case/simple-graph/package.json +11 -0
  241. package/plugins/@vcmap-show-case/simple-graph/src/SimpleGraphComponent.vue +59 -0
  242. package/plugins/@vcmap-show-case/simple-graph/src/index.js +17 -0
  243. package/plugins/@vcmap-show-case/simple-graph/src/simpleGraphView.js +78 -0
  244. package/plugins/@vcmap-show-case/style-input-example/README.md +4 -0
  245. package/plugins/@vcmap-show-case/style-input-example/package.json +5 -0
  246. package/plugins/@vcmap-show-case/style-input-example/src/StyleExample.vue +190 -0
  247. package/plugins/@vcmap-show-case/style-input-example/src/index.js +42 -0
  248. package/plugins/@vcmap-show-case/switch-map-callback-example/README.md +21 -0
  249. package/plugins/@vcmap-show-case/switch-map-callback-example/config.json +3 -0
  250. package/plugins/@vcmap-show-case/switch-map-callback-example/package.json +5 -0
  251. package/plugins/@vcmap-show-case/switch-map-callback-example/src/index.js +34 -0
  252. package/plugins/@vcmap-show-case/switch-map-callback-example/src/switchMapCallback.js +47 -0
  253. package/plugins/@vcmap-show-case/table-example/README.md +3 -0
  254. package/plugins/@vcmap-show-case/table-example/package.json +5 -0
  255. package/plugins/@vcmap-show-case/table-example/src/DataTableExample.vue +182 -0
  256. package/plugins/@vcmap-show-case/table-example/src/index.js +49 -0
  257. package/plugins/@vcmap-show-case/textfields-example/README.md +3 -0
  258. package/plugins/@vcmap-show-case/textfields-example/package.json +5 -0
  259. package/plugins/{example/mySuperComponent.vue → @vcmap-show-case/textfields-example/src/TextfieldsExample.vue} +13 -31
  260. package/plugins/@vcmap-show-case/textfields-example/src/index.js +64 -0
  261. package/plugins/{@vcmap → @vcmap-show-case}/theme-changer/README.md +5 -3
  262. package/plugins/@vcmap-show-case/theme-changer/config.json +69 -0
  263. package/plugins/@vcmap-show-case/theme-changer/package.json +11 -0
  264. package/plugins/{@vcmap/theme-changer → @vcmap-show-case/theme-changer/src}/ThemeChangerComponent.vue +36 -8
  265. package/plugins/{@vcmap/theme-changer → @vcmap-show-case/theme-changer/src}/index.js +14 -8
  266. package/plugins/@vcmap-show-case/vector-properties-example/package.json +5 -0
  267. package/plugins/@vcmap-show-case/vector-properties-example/src/VectorPropertiesExample.vue +128 -0
  268. package/plugins/@vcmap-show-case/vector-properties-example/src/index.js +40 -0
  269. package/plugins/@vcmap-show-case/window-tester/README.md +3 -0
  270. package/plugins/@vcmap-show-case/window-tester/package.json +5 -0
  271. package/plugins/@vcmap-show-case/window-tester/src/EmptyComponent.vue +18 -0
  272. package/plugins/@vcmap-show-case/window-tester/src/MyCustomHeader.vue +31 -0
  273. package/plugins/@vcmap-show-case/window-tester/src/WindowExample.vue +185 -0
  274. package/plugins/@vcmap-show-case/window-tester/src/WindowExampleContent.vue +18 -0
  275. package/plugins/@vcmap-show-case/window-tester/src/WindowExampleToggleChild.vue +45 -0
  276. package/plugins/@vcmap-show-case/window-tester/src/index.js +80 -0
  277. package/plugins/@vcmap-show-case/window-tester/src/toolboxData.js +288 -0
  278. package/plugins/@vcmap-show-case/wizard-example/README.md +3 -0
  279. package/plugins/@vcmap-show-case/wizard-example/package.json +5 -0
  280. package/plugins/@vcmap-show-case/wizard-example/src/WizardExample.vue +127 -0
  281. package/plugins/@vcmap-show-case/wizard-example/src/index.js +53 -0
  282. package/plugins/package.json +9 -2
  283. package/public/assets/@mdi/font/LICENSE +20 -0
  284. package/public/assets/@mdi/font/css/materialdesignicons.css.map +16 -0
  285. package/public/assets/@mdi/font/css/materialdesignicons.min.css +3 -0
  286. package/public/assets/@mdi/font/fonts/materialdesignicons-webfont.woff2 +0 -0
  287. package/public/assets/favicon-128.png +0 -0
  288. package/public/assets/favicon-180.png +0 -0
  289. package/public/assets/favicon-192.png +0 -0
  290. package/public/assets/favicon-32.png +0 -0
  291. package/public/assets/favicon.svg +10 -0
  292. package/public/assets/font/OFL.txt +93 -0
  293. package/public/assets/font/TitilliumWeb-Regular.woff2 +0 -0
  294. package/public/assets/style/icon-marker-blue.png +0 -0
  295. package/public/assets/style/icon-marker-green.png +0 -0
  296. package/public/assets/style/icon-marker-o-blue.png +0 -0
  297. package/public/assets/style/icon-marker-o-green.png +0 -0
  298. package/public/assets/style/icon-marker-o-red.png +0 -0
  299. package/public/assets/style/icon-marker-o.png +0 -0
  300. package/public/assets/style/icon-marker-red.png +0 -0
  301. package/public/assets/style/icon-marker.png +0 -0
  302. package/public/assets/style/icon-pin-blue.png +0 -0
  303. package/public/assets/style/icon-pin-green.png +0 -0
  304. package/public/assets/style/icon-pin-red.png +0 -0
  305. package/public/assets/style/icon-pin.png +0 -0
  306. package/src/actions/StyleSelector.vue +121 -0
  307. package/src/actions/actionHelper.js +184 -49
  308. package/src/actions/stateRefAction.js +2 -3
  309. package/src/application/VcsApp.vue +538 -98
  310. package/src/application/VcsAppWrapper.vue +32 -0
  311. package/src/application/VcsAttributions.vue +83 -0
  312. package/src/application/VcsAttributionsFooter.vue +83 -0
  313. package/src/application/VcsMap.vue +22 -5
  314. package/src/application/VcsNavbar.vue +217 -0
  315. package/src/application/VcsSettings.vue +98 -0
  316. package/src/application/attributionsHelper.js +162 -0
  317. package/src/callback/activateLayersCallback.js +54 -0
  318. package/src/callback/applyLayerStyleCallback.js +63 -0
  319. package/src/callback/deactivateLayersCallback.js +54 -0
  320. package/src/callback/goToViewpointCallback.js +54 -0
  321. package/src/callback/vcsCallback.js +66 -0
  322. package/src/components/ImageElementInjector.vue +24 -0
  323. package/src/components/buttons/VcsActionButtonList.vue +52 -22
  324. package/src/components/buttons/VcsButton.vue +60 -110
  325. package/src/components/buttons/VcsFormButton.vue +178 -0
  326. package/src/components/buttons/VcsToolButton.vue +161 -0
  327. package/src/components/form-inputs-controls/VcsCheckbox.vue +62 -20
  328. package/src/components/form-inputs-controls/VcsChipArrayInput.vue +290 -0
  329. package/src/components/form-inputs-controls/VcsDatePicker.vue +156 -0
  330. package/src/components/form-inputs-controls/VcsFormSection.vue +120 -16
  331. package/src/components/form-inputs-controls/VcsLabel.vue +29 -11
  332. package/src/components/form-inputs-controls/VcsRadio.vue +149 -0
  333. package/src/components/form-inputs-controls/VcsRadioGrid.vue +175 -0
  334. package/src/components/form-inputs-controls/VcsSelect.vue +164 -50
  335. package/src/components/form-inputs-controls/VcsSlider.vue +73 -0
  336. package/src/components/form-inputs-controls/VcsTextArea.vue +118 -68
  337. package/src/components/form-inputs-controls/VcsTextField.vue +238 -69
  338. package/src/components/form-inputs-controls/VcsWizard.vue +137 -0
  339. package/src/components/form-inputs-controls/VcsWizardStep.vue +161 -0
  340. package/src/components/form-inputs-controls/composables.js +31 -0
  341. package/src/components/form-output/VcsFormattedNumber.vue +28 -28
  342. package/src/{icons → components/icons}/+all.js +109 -5
  343. package/src/components/icons/2DAreaIcon.vue +58 -0
  344. package/src/components/icons/2DDistanceIcon.vue +24 -0
  345. package/src/components/icons/3DAreaIcon.vue +58 -0
  346. package/src/components/icons/3DDistanceIcon.vue +24 -0
  347. package/src/components/icons/3DHeightIcon.vue +24 -0
  348. package/src/components/icons/AngleIcon.vue +16 -0
  349. package/src/{icons → components/icons}/AssociationsIcon.vue +7 -4
  350. package/src/components/icons/AxisIcon.vue +35 -0
  351. package/src/components/icons/BoundingBoxIcon.vue +38 -0
  352. package/src/components/icons/CheckboxCheckedIcon.vue +12 -0
  353. package/src/components/icons/CheckboxIcon.vue +21 -0
  354. package/src/components/icons/CheckboxIndeterminateIcon.vue +10 -0
  355. package/src/components/icons/CircleIcon.vue +25 -0
  356. package/src/components/icons/ClippingHorizontalIcon.vue +18 -0
  357. package/src/components/icons/ClippingIcon.vue +17 -0
  358. package/src/components/icons/ClippingVerticalIcon.vue +18 -0
  359. package/src/components/icons/ColorPickerIcon.vue +17 -0
  360. package/src/{icons → components/icons}/ColorSwatchIcon.vue +6 -2
  361. package/src/{icons → components/icons}/CommentIcon.vue +6 -6
  362. package/src/components/icons/CompassIcon.vue +24 -0
  363. package/src/components/icons/ComponentsIcon.vue +18 -0
  364. package/src/components/icons/ConeIcon.vue +30 -0
  365. package/src/components/icons/DimensionsHouseIcon.vue +20 -0
  366. package/src/components/icons/EditIcon.vue +17 -0
  367. package/src/components/icons/EditVerticesIcon.vue +35 -0
  368. package/src/{icons → components/icons}/ElevationProfileIcon.vue +7 -14
  369. package/src/components/icons/ExportAreaIcon.vue +17 -0
  370. package/src/components/icons/ExportFlightIcon.vue +17 -0
  371. package/src/components/icons/ExportIcon.vue +24 -0
  372. package/src/components/icons/ExternalLinkIcon.vue +23 -0
  373. package/src/components/icons/EyeIcon.vue +17 -0
  374. package/src/components/icons/FastForwardIcon.vue +17 -0
  375. package/src/components/icons/FilterIcon.vue +18 -0
  376. package/src/components/icons/GlobalTerrainIcon.vue +19 -0
  377. package/src/components/icons/GlobeNatureIcon.vue +17 -0
  378. package/src/components/icons/GroundIcon.vue +27 -0
  379. package/src/{icons → components/icons}/HealthCareIndustriesIcon.vue +7 -12
  380. package/src/components/icons/HelpIcon.vue +17 -0
  381. package/src/components/icons/HideIcon.vue +25 -0
  382. package/src/components/icons/HomePointIcon.vue +17 -0
  383. package/src/{icons → components/icons}/HospitalsIcon.vue +7 -21
  384. package/src/components/icons/HouseIcon.vue +32 -0
  385. package/src/components/icons/ImportIcon.vue +18 -0
  386. package/src/components/icons/InfoIcon.vue +24 -0
  387. package/src/{icons → components/icons}/KebabIcon.vue +7 -5
  388. package/src/components/icons/LabelIcon.vue +23 -0
  389. package/src/{icons → components/icons}/LayersIcon.vue +7 -5
  390. package/src/components/icons/LegendIcon.vue +24 -0
  391. package/src/components/icons/LineIcon.vue +22 -0
  392. package/src/components/icons/LinkIcon.vue +17 -0
  393. package/src/components/icons/LogoutIcon.vue +17 -0
  394. package/src/components/icons/MapIcon.vue +18 -0
  395. package/src/{icons → components/icons}/MenuIcon.vue +7 -5
  396. package/src/components/icons/MinusIcon.vue +18 -0
  397. package/src/components/icons/ObjectAttributeIcon.vue +18 -0
  398. package/src/components/icons/ObjectSelectIcon.vue +18 -0
  399. package/src/components/icons/ObliqueViewIcon.vue +19 -0
  400. package/src/components/icons/PdfIcon.vue +19 -0
  401. package/src/components/icons/PedestrianIcon.vue +17 -0
  402. package/src/components/icons/PenIcon.vue +16 -0
  403. package/src/components/icons/PlayCircleIcon.vue +20 -0
  404. package/src/components/icons/PlusIcon.vue +18 -0
  405. package/src/components/icons/PoiIcon.vue +23 -0
  406. package/src/{icons/PolygonIcon.vue → components/icons/PointIcon.vue} +8 -6
  407. package/src/components/icons/PointSelectIcon.vue +18 -0
  408. package/src/components/icons/PresentationModeIcon.vue +17 -0
  409. package/src/{icons → components/icons}/ProgressIcon.vue +9 -7
  410. package/src/components/icons/QueryIcon.vue +39 -0
  411. package/src/components/icons/RectangleIcon.vue +24 -0
  412. package/src/components/icons/ReturnIcon.vue +17 -0
  413. package/src/components/icons/RewindIcon.vue +16 -0
  414. package/src/components/icons/RotateLeftIcon.vue +17 -0
  415. package/src/components/icons/RotateRightIcon.vue +17 -0
  416. package/src/components/icons/ScreenshotIcon.vue +53 -0
  417. package/src/components/icons/SearchIcon.vue +17 -0
  418. package/src/components/icons/ShadowIcon.vue +18 -0
  419. package/src/{icons → components/icons}/ShapesIcon.vue +13 -6
  420. package/src/components/icons/ShareIcon.vue +22 -0
  421. package/src/components/icons/SimpleCircleFilledIcon.vue +18 -0
  422. package/src/{icons → components/icons}/SimpleCircleHalfFilledIcon.vue +6 -2
  423. package/src/components/icons/SimpleCircleOutlinedIcon.vue +13 -0
  424. package/src/components/icons/SkipNextIcon.vue +18 -0
  425. package/src/components/icons/SkipPreviousIcon.vue +18 -0
  426. package/src/{icons → components/icons}/SplitViewIcon.vue +6 -6
  427. package/src/components/icons/TerrainBoxIcon.vue +19 -0
  428. package/src/components/icons/TextStyleIcon.vue +17 -0
  429. package/src/components/icons/ThreeDimensionsIcon.vue +17 -0
  430. package/src/components/icons/ToolsIcon.vue +16 -0
  431. package/src/components/icons/TouchIcon.vue +18 -0
  432. package/src/components/icons/TrashCanIcon.vue +18 -0
  433. package/src/components/icons/TriangleIcon.vue +16 -0
  434. package/src/components/icons/TwoDimensionsIcon.vue +18 -0
  435. package/src/components/icons/UploadIcon.vue +17 -0
  436. package/src/components/icons/UserProfileIcon.vue +17 -0
  437. package/src/components/icons/UserShareIcon.vue +16 -0
  438. package/src/components/icons/VideoRecorderIcon.vue +23 -0
  439. package/src/components/icons/ViewpointFlightIcon.vue +28 -0
  440. package/src/components/icons/ViewpointIcon.vue +28 -0
  441. package/src/components/icons/Viewshed360Icon.vue +18 -0
  442. package/src/components/icons/ViewshedConeIcon.vue +17 -0
  443. package/src/components/icons/ViewshedIcon.vue +18 -0
  444. package/src/components/icons/WalkingIcon.vue +17 -0
  445. package/src/components/icons/WallIcon.vue +22 -0
  446. package/src/components/icons/WandIcon.vue +123 -0
  447. package/src/components/lists/VcsActionList.vue +57 -25
  448. package/src/components/lists/VcsList.vue +590 -0
  449. package/src/components/lists/VcsTreeview.vue +45 -42
  450. package/src/components/lists/VcsTreeviewLeaf.vue +45 -69
  451. package/src/components/lists/VcsTreeviewSearchbar.vue +40 -48
  452. package/src/components/notification/VcsBadge.vue +6 -4
  453. package/src/components/notification/VcsHelp.vue +39 -0
  454. package/src/components/notification/VcsTooltip.vue +111 -105
  455. package/src/components/notification/validation.js +1 -1
  456. package/src/components/plugins/AbstractConfigEditor.vue +84 -0
  457. package/src/components/style/MenuWrapper.vue +140 -0
  458. package/src/components/style/VcsFillMenu.vue +61 -0
  459. package/src/components/style/VcsFillSelector.vue +45 -0
  460. package/src/components/style/VcsImageMenu.vue +83 -0
  461. package/src/components/style/VcsImageSelector.vue +577 -0
  462. package/src/components/style/VcsStrokeMenu.vue +73 -0
  463. package/src/components/style/VcsStrokeSelector.vue +88 -0
  464. package/src/components/style/VcsTextMenu.vue +81 -0
  465. package/src/components/style/VcsTextSelector.vue +269 -0
  466. package/src/components/style/VcsVectorStyleComponent.vue +114 -0
  467. package/src/components/style/composables.js +84 -0
  468. package/src/components/tables/VcsDataTable.vue +475 -0
  469. package/src/components/tables/VcsTable.vue +145 -0
  470. package/src/components/vector-properties/VcsVectorPropertiesComponent.vue +778 -0
  471. package/src/components/vector-properties/composables.js +93 -0
  472. package/src/contentTree/LayerTree.vue +18 -14
  473. package/src/contentTree/contentTreeCollection.js +109 -41
  474. package/src/contentTree/contentTreeItem.js +109 -43
  475. package/src/contentTree/groupContentTreeItem.js +46 -23
  476. package/src/contentTree/layerContentTreeItem.js +54 -23
  477. package/src/contentTree/layerGroupContentTreeItem.js +58 -26
  478. package/src/contentTree/nodeContentTreeItem.js +19 -8
  479. package/src/contentTree/obliqueCollectionContentTreeItem.js +51 -22
  480. package/src/contentTree/subContentTreeItem.js +14 -5
  481. package/src/contentTree/vcsObjectContentTreeItem.js +27 -16
  482. package/src/contentTree/viewpointContentTreeItem.js +121 -0
  483. package/src/downloadHelper.js +52 -0
  484. package/src/featureInfo/AddressBalloonComponent.vue +58 -0
  485. package/src/featureInfo/BalloonComponent.vue +193 -0
  486. package/src/featureInfo/abstractFeatureInfoView.js +346 -0
  487. package/src/featureInfo/addressBalloonFeatureInfoView.js +130 -0
  488. package/src/featureInfo/balloonFeatureInfoView.js +159 -0
  489. package/src/featureInfo/balloonHelper.js +172 -0
  490. package/src/featureInfo/featureInfo.js +525 -0
  491. package/src/featureInfo/featureInfoInteraction.js +48 -0
  492. package/src/featureInfo/iframeFeatureInfoView.js +97 -0
  493. package/src/featureInfo/tableFeatureInfoView.js +120 -0
  494. package/src/i18n/de.js +195 -0
  495. package/src/i18n/en.js +195 -0
  496. package/src/i18n/i18nCollection.js +137 -0
  497. package/src/init.js +121 -36
  498. package/src/legend/StyleLegendItem.vue +176 -0
  499. package/src/legend/VcsLegend.vue +140 -0
  500. package/src/legend/legendHelper.js +204 -0
  501. package/src/manager/buttonManager.js +32 -15
  502. package/src/manager/collectionManager/CollectionComponent.vue +140 -0
  503. package/src/manager/collectionManager/CollectionComponentList.vue +77 -0
  504. package/src/manager/collectionManager/CollectionComponentProvider.vue +39 -0
  505. package/src/manager/collectionManager/CollectionManager.vue +62 -0
  506. package/src/manager/collectionManager/categoryManager.js +83 -0
  507. package/src/manager/collectionManager/collectionComponent.js +470 -0
  508. package/src/manager/collectionManager/collectionManager.js +432 -0
  509. package/src/manager/contextMenu/ContextMenuComponent.vue +43 -0
  510. package/src/manager/contextMenu/contextMenuInteraction.js +47 -0
  511. package/src/manager/contextMenu/contextMenuManager.js +220 -0
  512. package/src/manager/navbarManager.js +47 -13
  513. package/src/manager/toolbox/GroupToolboxComponent.vue +128 -0
  514. package/src/manager/toolbox/SelectToolboxComponent.vue +144 -0
  515. package/src/manager/toolbox/ToolboxManager.vue +124 -102
  516. package/src/manager/toolbox/toolboxManager.js +254 -87
  517. package/src/manager/window/WindowComponent.vue +105 -85
  518. package/src/manager/window/WindowComponentHeader.vue +115 -24
  519. package/src/manager/window/WindowManager.vue +121 -55
  520. package/src/manager/window/windowHelper.js +465 -0
  521. package/src/manager/window/windowManager.js +294 -86
  522. package/src/navigation/{mapNavCompass.vue → MapNavCompass.vue} +31 -11
  523. package/src/navigation/MapNavigation.vue +291 -0
  524. package/src/navigation/ObliqueRotation.vue +69 -0
  525. package/src/navigation/{orientationToolsButton.vue → OrientationToolsButton.vue} +13 -12
  526. package/src/navigation/{tiltSlider.vue → TiltSlider.vue} +39 -16
  527. package/src/navigation/VcsCompass.vue +69 -0
  528. package/src/navigation/VcsZoomButton.vue +52 -0
  529. package/src/navigation/overviewMap.js +142 -104
  530. package/src/navigation/overviewMapClickedInteraction.js +6 -1
  531. package/src/notifier/NotifierComponent.vue +86 -0
  532. package/src/notifier/notifier.js +129 -0
  533. package/src/pluginHelper.js +148 -20
  534. package/src/search/ResultItem.vue +83 -0
  535. package/src/search/ResultsComponent.vue +103 -0
  536. package/src/search/SearchComponent.vue +116 -0
  537. package/src/search/search.js +342 -0
  538. package/src/setup.js +9 -10
  539. package/src/state.js +272 -0
  540. package/src/styles/_theming.scss +69 -21
  541. package/src/styles/_typography.scss +3 -6
  542. package/src/styles/main.scss +9 -0
  543. package/src/styles/shades.scss +4 -0
  544. package/src/styles/utils/_border.scss +1 -1
  545. package/src/styles/utils/_cursor.scss +4 -0
  546. package/src/styles/utils/_display.scss +1 -1
  547. package/src/styles/variables.scss +79 -11
  548. package/src/styles/vcsFont.scss +2 -5
  549. package/src/styles/vcsGrid.scss +9 -0
  550. package/src/uiConfig.js +83 -0
  551. package/src/vcsUiApp.js +508 -68
  552. package/src/vuePlugins/i18n.js +51 -13
  553. package/src/vuePlugins/vuetify.js +104 -43
  554. package/config/berlin.config.json +0 -529
  555. package/dist/assets/cesium/Workers/ArcType-fc72c06c.js +0 -1
  556. package/dist/assets/cesium/Workers/AttributeCompression-80665726.js +0 -1
  557. package/dist/assets/cesium/Workers/AxisAlignedBoundingBox-a655a4bc.js +0 -1
  558. package/dist/assets/cesium/Workers/BoundingRectangle-c3b79029.js +0 -1
  559. package/dist/assets/cesium/Workers/BoxGeometry-f8f9c981.js +0 -1
  560. package/dist/assets/cesium/Workers/Color-de06a177.js +0 -1
  561. package/dist/assets/cesium/Workers/ComponentDatatype-a15c9a19.js +0 -1
  562. package/dist/assets/cesium/Workers/CoplanarPolygonGeometryLibrary-48cdc26d.js +0 -1
  563. package/dist/assets/cesium/Workers/CorridorGeometryLibrary-ddc027d3.js +0 -1
  564. package/dist/assets/cesium/Workers/CylinderGeometry-82a8cbe6.js +0 -1
  565. package/dist/assets/cesium/Workers/CylinderGeometryLibrary-76cda53e.js +0 -1
  566. package/dist/assets/cesium/Workers/EllipseGeometry-32d55454.js +0 -1
  567. package/dist/assets/cesium/Workers/EllipseGeometryLibrary-b2ae188a.js +0 -1
  568. package/dist/assets/cesium/Workers/EllipseOutlineGeometry-f05a5a27.js +0 -1
  569. package/dist/assets/cesium/Workers/EllipsoidGeodesic-19e75e11.js +0 -1
  570. package/dist/assets/cesium/Workers/EllipsoidGeometry-7c99fc81.js +0 -1
  571. package/dist/assets/cesium/Workers/EllipsoidOutlineGeometry-21c243df.js +0 -1
  572. package/dist/assets/cesium/Workers/EllipsoidRhumbLine-6145377b.js +0 -1
  573. package/dist/assets/cesium/Workers/EllipsoidTangentPlane-a01286f6.js +0 -1
  574. package/dist/assets/cesium/Workers/EncodedCartesian3-d9f5c4a4.js +0 -1
  575. package/dist/assets/cesium/Workers/FrustumGeometry-17776af8.js +0 -1
  576. package/dist/assets/cesium/Workers/GeometryAttribute-89a520b9.js +0 -1
  577. package/dist/assets/cesium/Workers/GeometryAttributes-32b29525.js +0 -1
  578. package/dist/assets/cesium/Workers/GeometryInstance-4fbf16ba.js +0 -1
  579. package/dist/assets/cesium/Workers/GeometryOffsetAttribute-8c5e10db.js +0 -1
  580. package/dist/assets/cesium/Workers/GeometryPipeline-309fad76.js +0 -1
  581. package/dist/assets/cesium/Workers/IndexDatatype-f1dcdf35.js +0 -1
  582. package/dist/assets/cesium/Workers/IntersectionTests-58aa8f80.js +0 -1
  583. package/dist/assets/cesium/Workers/Matrix2-47e98d76.js +0 -1
  584. package/dist/assets/cesium/Workers/OrientedBoundingBox-fcb5b750.js +0 -1
  585. package/dist/assets/cesium/Workers/Plane-3f01019d.js +0 -1
  586. package/dist/assets/cesium/Workers/PolygonGeometryLibrary-0b29eb16.js +0 -1
  587. package/dist/assets/cesium/Workers/PolygonPipeline-a934c4dd.js +0 -1
  588. package/dist/assets/cesium/Workers/PolylinePipeline-8095c9bc.js +0 -1
  589. package/dist/assets/cesium/Workers/PolylineVolumeGeometryLibrary-67d12fff.js +0 -1
  590. package/dist/assets/cesium/Workers/PrimitivePipeline-980e44c5.js +0 -1
  591. package/dist/assets/cesium/Workers/RectangleGeometryLibrary-621c6de8.js +0 -1
  592. package/dist/assets/cesium/Workers/RuntimeError-8952249c.js +0 -1
  593. package/dist/assets/cesium/Workers/TerrainEncoding-f96552d5.js +0 -1
  594. package/dist/assets/cesium/Workers/Transforms-c8cb8f43.js +0 -39
  595. package/dist/assets/cesium/Workers/VertexFormat-a0b706b0.js +0 -1
  596. package/dist/assets/cesium/Workers/WallGeometryLibrary-c03d8479.js +0 -1
  597. package/dist/assets/cesium/Workers/WebGLConstants-508b9636.js +0 -1
  598. package/dist/assets/cesium/Workers/WebMercatorProjection-79b3214e.js +0 -1
  599. package/dist/assets/cesium/Workers/_commonjsHelpers-3aae1032-26891ab7.js +0 -1
  600. package/dist/assets/cesium/Workers/_rollup_plugin_ignore_empty_module_placeholder-57d574d0.js +0 -1
  601. package/dist/assets/cesium/Workers/arrayRemoveDuplicates-dc2f4046.js +0 -1
  602. package/dist/assets/cesium/Workers/cesiumWorkerBootstrapper.js +0 -6
  603. package/dist/assets/cesium/Workers/combine-3c023bda.js +0 -1
  604. package/dist/assets/cesium/Workers/defaultValue-81eec7ed.js +0 -1
  605. package/dist/assets/cesium.4e40f4.js +0 -9105
  606. package/dist/assets/core.edcf5e.js +0 -4
  607. package/dist/assets/index.60dea538.css +0 -1
  608. package/dist/assets/index.889d0f3a.js +0 -1
  609. package/dist/assets/ol.246fd4.js +0 -318
  610. package/dist/assets/ui.df4f6d.css +0 -1
  611. package/dist/assets/ui.df4f6d.js +0 -43
  612. package/dist/assets/vue-composition-api.a520f3.js +0 -14
  613. package/dist/assets/vue-composition-api.js +0 -2
  614. package/dist/assets/vue.2cee44.js +0 -9
  615. package/dist/assets/vuetify.cc817b.css +0 -5
  616. package/dist/assets/vuetify.cc817b.js +0 -48
  617. package/lib/vue-composition-api.js +0 -2
  618. package/map.config.json +0 -35
  619. package/plugins/@vcmap/pluginExample/config.json +0 -6
  620. package/plugins/@vcmap/pluginExample/package.json +0 -7
  621. package/plugins/@vcmap/pluginExample/pluginExampleComponent.vue +0 -374
  622. package/plugins/@vcmap/project-selector/ProjectSelectorComponent.vue +0 -81
  623. package/plugins/@vcmap/project-selector/README.md +0 -29
  624. package/plugins/@vcmap/project-selector/config.json +0 -15
  625. package/plugins/@vcmap/project-selector/index.js +0 -254
  626. package/plugins/@vcmap/theme-changer/config.json +0 -69
  627. package/plugins/@vcmap/theme-changer/package.json +0 -12
  628. package/plugins/buttonExamples/ButtonExamples.vue +0 -190
  629. package/plugins/buttonExamples/index.js +0 -41
  630. package/plugins/categoryTest/Categories.vue +0 -145
  631. package/plugins/categoryTest/Category.vue +0 -114
  632. package/plugins/categoryTest/ItemEditor.vue +0 -13
  633. package/plugins/categoryTest/index.js +0 -41
  634. package/plugins/example/index.js +0 -75
  635. package/plugins/test/allIconsComponent.vue +0 -34
  636. package/plugins/test/editor.vue +0 -63
  637. package/plugins/test/index.js +0 -116
  638. package/plugins/test/myCustomHeader.vue +0 -19
  639. package/plugins/test/toolbox-data.js +0 -129
  640. package/plugins/test/vcsContent.vue +0 -23
  641. package/plugins/test/windowManagerExample.vue +0 -143
  642. package/src/actions/styleSelector.vue +0 -90
  643. package/src/application/Navbar.vue +0 -130
  644. package/src/application/empty-cmp.vue +0 -6
  645. package/src/components/form-inputs-controls/VcsColorPicker.vue +0 -81
  646. package/src/contentTree/viewPointContentTreeItem.js +0 -107
  647. package/src/icons/2DAreaIcon.vue +0 -21
  648. package/src/icons/2DDistanceIcon.vue +0 -18
  649. package/src/icons/3DAreaIcon.vue +0 -21
  650. package/src/icons/3DDistanceIcon.vue +0 -18
  651. package/src/icons/3DHeightIcon.vue +0 -18
  652. package/src/icons/AngleIcon.vue +0 -8
  653. package/src/icons/AxisIcon.vue +0 -10
  654. package/src/icons/BoundingBoxIcon.vue +0 -15
  655. package/src/icons/CheckboxCheckedIcon.vue +0 -16
  656. package/src/icons/CheckboxIcon.vue +0 -23
  657. package/src/icons/CheckboxIndeterminateIcon.vue +0 -24
  658. package/src/icons/CircleIcon.vue +0 -10
  659. package/src/icons/CompassIcon.vue +0 -8
  660. package/src/icons/ComponentsIcon.vue +0 -7
  661. package/src/icons/ConeIcon.vue +0 -11
  662. package/src/icons/DimensionsHouseIcon.vue +0 -14
  663. package/src/icons/ExportAreaIcon.vue +0 -7
  664. package/src/icons/ExportFlightIcon.vue +0 -7
  665. package/src/icons/ExportIcon.vue +0 -8
  666. package/src/icons/ExternalLinkIcon.vue +0 -10
  667. package/src/icons/EyeIcon.vue +0 -7
  668. package/src/icons/FastForwardIcon.vue +0 -7
  669. package/src/icons/FilterIcon.vue +0 -8
  670. package/src/icons/GlobeNatureIcon.vue +0 -14
  671. package/src/icons/HelpIcon.vue +0 -7
  672. package/src/icons/HomePointIcon.vue +0 -8
  673. package/src/icons/HouseIcon.vue +0 -25
  674. package/src/icons/ImportIcon.vue +0 -8
  675. package/src/icons/InfoIcon.vue +0 -10
  676. package/src/icons/LabelIcon.vue +0 -7
  677. package/src/icons/LegendIcon.vue +0 -65
  678. package/src/icons/LineIcon.vue +0 -7
  679. package/src/icons/LinkIcon.vue +0 -7
  680. package/src/icons/MapIcon.vue +0 -8
  681. package/src/icons/MinusIcon.vue +0 -8
  682. package/src/icons/ObjectAttributeIcon.vue +0 -18
  683. package/src/icons/ObjectSelectIcon.vue +0 -8
  684. package/src/icons/ObliqueViewIcon.vue +0 -13
  685. package/src/icons/PdfIcon.vue +0 -10
  686. package/src/icons/PedestrianIcon.vue +0 -8
  687. package/src/icons/PenIcon.vue +0 -14
  688. package/src/icons/PlayCircleIcon.vue +0 -10
  689. package/src/icons/PlusIcon.vue +0 -9
  690. package/src/icons/PoiIcon.vue +0 -7
  691. package/src/icons/PointSelectIcon.vue +0 -7
  692. package/src/icons/PresentationModeIcon.vue +0 -7
  693. package/src/icons/QueryIcon.vue +0 -15
  694. package/src/icons/RectangleIcon.vue +0 -9
  695. package/src/icons/ReturnIcon.vue +0 -7
  696. package/src/icons/RewindIcon.vue +0 -6
  697. package/src/icons/SearchIcon.vue +0 -8
  698. package/src/icons/ShadowIcon.vue +0 -9
  699. package/src/icons/ShareIcon.vue +0 -22
  700. package/src/icons/SimpleCircleFilledIcon.vue +0 -15
  701. package/src/icons/SimpleCircleOutlinedIcon.vue +0 -15
  702. package/src/icons/SkipNextIcon.vue +0 -7
  703. package/src/icons/SkipPreviousIcon.vue +0 -9
  704. package/src/icons/TextStyleIcon.vue +0 -14
  705. package/src/icons/ThreeDimensionsIcon.vue +0 -7
  706. package/src/icons/ToolsIcon.vue +0 -35
  707. package/src/icons/TouchIcon.vue +0 -8
  708. package/src/icons/TrashCanIcon.vue +0 -7
  709. package/src/icons/TriangleIcon.vue +0 -15
  710. package/src/icons/TwoDimensionsIcon.vue +0 -8
  711. package/src/icons/UploadIcon.vue +0 -14
  712. package/src/icons/VideoRecorderIcon.vue +0 -14
  713. package/src/icons/WalkingIcon.vue +0 -7
  714. package/src/icons/WallIcon.vue +0 -14
  715. package/src/lang/de.js +0 -60
  716. package/src/lang/en.js +0 -53
  717. package/src/manager/toolbox/ToolboxGroupComponent.vue +0 -128
  718. package/src/navigation/mapNavigation.vue +0 -205
  719. package/src/navigation/obliqueRotation.vue +0 -48
  720. package/src/navigation/vcsCompass.vue +0 -144
  721. package/src/navigation/vcsZoomButton.vue +0 -27
  722. package/start.js +0 -3
  723. /package/src/{assets/logo-mobile.svg → logo-mobile.svg} +0 -0
  724. /package/src/{assets/logo.svg → logo.svg} +0 -0
@@ -1,3 +1,2277 @@
1
- define(["./Matrix2-47e98d76","./AxisAlignedBoundingBox-a655a4bc","./Transforms-c8cb8f43","./defaultValue-81eec7ed","./RuntimeError-8952249c","./TerrainEncoding-f96552d5","./ComponentDatatype-a15c9a19","./OrientedBoundingBox-fcb5b750","./WebMercatorProjection-79b3214e","./_commonjsHelpers-3aae1032-26891ab7","./createTaskProcessorWorker","./combine-3c023bda","./AttributeCompression-80665726","./WebGLConstants-508b9636","./EllipsoidTangentPlane-a01286f6","./IntersectionTests-58aa8f80","./Plane-3f01019d"],(function(e,t,i,a,n,r,s,l,o,f,u,c,d,h,m,g,p){"use strict";var x=Object.freeze({NONE:0,LERC:1});const w={};w.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});const k=new e.Cartesian3,y=new e.Matrix4,I=new e.Cartesian3,b=new e.Cartesian3;w.computeVertices=function(n){const f=Math.cos,u=Math.sin,c=Math.sqrt,d=Math.atan,h=Math.exp,m=s.CesiumMath.PI_OVER_TWO,g=s.CesiumMath.toRadians,p=n.heightmap,x=n.width,U=n.height,T=n.skirtHeight,M=T>0,V=a.defaultValue(n.isGeographic,!0),v=a.defaultValue(n.ellipsoid,e.Ellipsoid.WGS84),A=1/v.maximumRadius,B=e.Rectangle.clone(n.nativeRectangle),D=e.Rectangle.clone(n.rectangle);let S,P,E,C;a.defined(D)?(S=D.west,P=D.south,E=D.east,C=D.north):V?(S=g(B.west),P=g(B.south),E=g(B.east),C=g(B.north)):(S=B.west*A,P=m-2*d(h(-B.south*A)),E=B.east*A,C=m-2*d(h(-B.north*A)));let F=n.relativeToCenter;const N=a.defined(F);F=N?F:e.Cartesian3.ZERO;const O=a.defaultValue(n.includeWebMercatorT,!1),R=a.defaultValue(n.exaggeration,1),L=a.defaultValue(n.exaggerationRelativeHeight,0),z=1!==R,H=a.defaultValue(n.structure,w.DEFAULT_STRUCTURE),_=a.defaultValue(H.heightScale,w.DEFAULT_STRUCTURE.heightScale),Y=a.defaultValue(H.heightOffset,w.DEFAULT_STRUCTURE.heightOffset),W=a.defaultValue(H.elementsPerHeight,w.DEFAULT_STRUCTURE.elementsPerHeight),X=a.defaultValue(H.stride,w.DEFAULT_STRUCTURE.stride),Z=a.defaultValue(H.elementMultiplier,w.DEFAULT_STRUCTURE.elementMultiplier),j=a.defaultValue(H.isBigEndian,w.DEFAULT_STRUCTURE.isBigEndian);let G=e.Rectangle.computeWidth(B),q=e.Rectangle.computeHeight(B);const Q=G/(x-1),J=q/(U-1);V||(G*=A,q*=A);const K=v.radiiSquared,$=K.x,ee=K.y,te=K.z;let ie=65536,ae=-65536;const ne=i.Transforms.eastNorthUpToFixedFrame(F,v),re=e.Matrix4.inverseTransformation(ne,y);let se,le;O&&(se=o.WebMercatorProjection.geodeticLatitudeToMercatorAngle(P),le=1/(o.WebMercatorProjection.geodeticLatitudeToMercatorAngle(C)-se));const oe=I;oe.x=Number.POSITIVE_INFINITY,oe.y=Number.POSITIVE_INFINITY,oe.z=Number.POSITIVE_INFINITY;const fe=b;fe.x=Number.NEGATIVE_INFINITY,fe.y=Number.NEGATIVE_INFINITY,fe.z=Number.NEGATIVE_INFINITY;let ue=Number.POSITIVE_INFINITY;const ce=x*U,de=ce+(T>0?2*x+2*U:0),he=new Array(de),me=new Array(de),ge=new Array(de),pe=O?new Array(de):[],xe=z?new Array(de):[];let we=0,ke=U,ye=0,Ie=x;M&&(--we,++ke,--ye,++Ie);const be=1e-5;for(let t=we;t<ke;++t){let i=t;i<0&&(i=0),i>=U&&(i=U-1);let a=B.north-J*i;a=V?g(a):m-2*d(h(-a*A));let n=(a-P)/(C-P);n=s.CesiumMath.clamp(n,0,1);const r=t===we,l=t===ke-1;T>0&&(r?a+=be*q:l&&(a-=be*q));const w=f(a),y=u(a),I=te*y;let b;O&&(b=(o.WebMercatorProjection.geodeticLatitudeToMercatorAngle(a)-se)*le);for(let t=ye;t<Ie;++t){let a=t;a<0&&(a=0),a>=x&&(a=x-1);const o=i*(x*X)+a*X;let d;if(1===W)d=p[o];else{let e;if(d=0,j)for(e=0;e<W;++e)d=d*Z+p[o+e];else for(e=W-1;e>=0;--e)d=d*Z+p[o+e]}d=d*_+Y,ae=Math.max(ae,d),ie=Math.min(ie,d);let h=B.west+Q*a;V?h=g(h):h*=A;let m=(h-S)/(E-S);m=s.CesiumMath.clamp(m,0,1);let M=i*x+a;if(T>0){const e=t===ye,n=t===Ie-1,s=r||l||e||n;if((r||l)&&(e||n))continue;s&&(d-=T,e?(M=ce+(U-i-1),h-=be*G):l?M=ce+U+(x-a-1):n?(M=ce+U+x+i,h+=be*G):r&&(M=ce+U+x+U+a))}const D=w*f(h),P=w*u(h),C=$*D,F=ee*P,N=1/c(C*D+F*P+I*y),R=C*N,L=F*N,H=I*N,q=new e.Cartesian3;q.x=R+D*d,q.y=L+P*d,q.z=H+y*d,e.Matrix4.multiplyByPoint(re,q,k),e.Cartesian3.minimumByComponent(k,oe,oe),e.Cartesian3.maximumByComponent(k,fe,fe),ue=Math.min(ue,d),he[M]=q,ge[M]=new e.Cartesian2(m,n),me[M]=d,O&&(pe[M]=b),z&&(xe[M]=v.geodeticSurfaceNormal(q))}}const Ue=i.BoundingSphere.fromPoints(he);let Te,Me;if(a.defined(D)&&(Te=l.OrientedBoundingBox.fromRectangle(D,ie,ae,v)),N){Me=new r.EllipsoidalOccluder(v).computeHorizonCullingPointPossiblyUnderEllipsoid(F,he,ie)}const Ve=new t.AxisAlignedBoundingBox(oe,fe,F),ve=new r.TerrainEncoding(F,Ve,ue,ae,ne,!1,O,z,R,L),Ae=new Float32Array(de*ve.stride);let Be=0;for(let e=0;e<de;++e)Be=ve.encode(Ae,Be,he[e],ge[e],me[e],void 0,pe[e],xe[e]);return{vertices:Ae,maximumHeight:ae,minimumHeight:ie,encoding:ve,boundingSphere3D:Ue,orientedBoundingBox:Te,occludeePointInScaledSpace:Me}};var U=f.createCommonjsModule((function(e){
2
- /* 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 */
3
- !function(){var t,i,a,n,r,s,l,o,f,u,c,d,h,m,g,p,x=(t={defaultNoDataValue:-34027999387901484e22,decode:function(e,s){var l=(s=s||{}).encodedMaskData||null===s.encodedMaskData,o=r(e,s.inputOffset||0,l),f=null!==s.noDataValue?s.noDataValue:t.defaultNoDataValue,u=i(o,s.pixelType||Float32Array,s.encodedMaskData,f,s.returnMask),c={width:o.width,height:o.height,pixelData:u.resultPixels,minValue:u.minValue,maxValue:o.pixels.maxValue,noDataValue:f};return u.resultMask&&(c.maskData=u.resultMask),s.returnEncodedMask&&o.mask&&(c.encodedMaskData=o.mask.bitset?o.mask.bitset:null),s.returnFileInfo&&(c.fileInfo=a(o),s.computeUsedBitDepths&&(c.fileInfo.bitDepths=n(o))),c}},i=function(e,t,i,a,n){var r,l,o,f=0,u=e.pixels.numBlocksX,c=e.pixels.numBlocksY,d=Math.floor(e.width/u),h=Math.floor(e.height/c),m=2*e.maxZError,g=Number.MAX_VALUE;i=i||(e.mask?e.mask.bitset:null),l=new t(e.width*e.height),n&&i&&(o=new Uint8Array(e.width*e.height));for(var p,x,w=new Float32Array(d*h),k=0;k<=c;k++){var y=k!==c?h:e.height%c;if(0!==y)for(var I=0;I<=u;I++){var b=I!==u?d:e.width%u;if(0!==b){var U,T,M,V,v=k*e.width*h+I*d,A=e.width-b,B=e.pixels.blocks[f];if(B.encoding<2?(0===B.encoding?U=B.rawData:(s(B.stuffedData,B.bitsPerPixel,B.numValidPixels,B.offset,m,w,e.pixels.maxValue),U=w),T=0):M=2===B.encoding?0:B.offset,i)for(x=0;x<y;x++){for(7&v&&(V=i[v>>3],V<<=7&v),p=0;p<b;p++)7&v||(V=i[v>>3]),128&V?(o&&(o[v]=1),g=g>(r=B.encoding<2?U[T++]:M)?r:g,l[v++]=r):(o&&(o[v]=0),l[v++]=a),V<<=1;v+=A}else if(B.encoding<2)for(x=0;x<y;x++){for(p=0;p<b;p++)g=g>(r=U[T++])?r:g,l[v++]=r;v+=A}else for(g=g>M?M:g,x=0;x<y;x++){for(p=0;p<b;p++)l[v++]=M;v+=A}if(1===B.encoding&&T!==B.numValidPixels)throw"Block and Mask do not match";f++}}}return{resultPixels:l,resultMask:o,minValue:g}},a=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}}},n=function(e){for(var t=e.pixels.numBlocksX*e.pixels.numBlocksY,i={},a=0;a<t;a++){var n=e.pixels.blocks[a];0===n.encoding?i.float32=!0:1===n.encoding?i[n.bitsPerPixel]=!0:i[0]=!0}return Object.keys(i)},r=function(e,t,i){var a={},n=new Uint8Array(e,t,10);if(a.fileIdentifierString=String.fromCharCode.apply(null,n),"CntZImage"!==a.fileIdentifierString.trim())throw"Unexpected file identifier string: "+a.fileIdentifierString;t+=10;var r=new DataView(e,t,24);if(a.fileVersion=r.getInt32(0,!0),a.imageType=r.getInt32(4,!0),a.height=r.getUint32(8,!0),a.width=r.getUint32(12,!0),a.maxZError=r.getFloat64(16,!0),t+=24,!i)if(r=new DataView(e,t,16),a.mask={},a.mask.numBlocksY=r.getUint32(0,!0),a.mask.numBlocksX=r.getUint32(4,!0),a.mask.numBytes=r.getUint32(8,!0),a.mask.maxValue=r.getFloat32(12,!0),t+=16,a.mask.numBytes>0){var s=new Uint8Array(Math.ceil(a.width*a.height/8)),l=(r=new DataView(e,t,a.mask.numBytes)).getInt16(0,!0),o=2,f=0;do{if(l>0)for(;l--;)s[f++]=r.getUint8(o++);else{var u=r.getUint8(o++);for(l=-l;l--;)s[f++]=u}l=r.getInt16(o,!0),o+=2}while(o<a.mask.numBytes);if(-32768!==l||f<s.length)throw"Unexpected end of mask RLE encoding";a.mask.bitset=s,t+=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)));r=new DataView(e,t,16),a.pixels={},a.pixels.numBlocksY=r.getUint32(0,!0),a.pixels.numBlocksX=r.getUint32(4,!0),a.pixels.numBytes=r.getUint32(8,!0),a.pixels.maxValue=r.getFloat32(12,!0),t+=16;var c=a.pixels.numBlocksX,d=a.pixels.numBlocksY,h=c+(a.width%c>0?1:0),m=d+(a.height%d>0?1:0);a.pixels.blocks=new Array(h*m);for(var g=0,p=0;p<m;p++)for(var x=0;x<h;x++){var w=0,k=e.byteLength-t;r=new DataView(e,t,Math.min(10,k));var y={};a.pixels.blocks[g++]=y;var I=r.getUint8(0);if(w++,y.encoding=63&I,y.encoding>3)throw"Invalid block encoding ("+y.encoding+")";if(2!==y.encoding){if(0!==I&&2!==I){if(I>>=6,y.offsetType=I,2===I)y.offset=r.getInt8(1),w++;else if(1===I)y.offset=r.getInt16(1,!0),w+=2;else{if(0!==I)throw"Invalid block offset type";y.offset=r.getFloat32(1,!0),w+=4}if(1===y.encoding)if(I=r.getUint8(w),w++,y.bitsPerPixel=63&I,I>>=6,y.numValidPixelsType=I,2===I)y.numValidPixels=r.getUint8(w),w++;else if(1===I)y.numValidPixels=r.getUint16(w,!0),w+=2;else{if(0!==I)throw"Invalid valid pixel count type";y.numValidPixels=r.getUint32(w,!0),w+=4}}var b;if(t+=w,3!==y.encoding)if(0===y.encoding){var U=(a.pixels.numBytes-1)/4;if(U!==Math.floor(U))throw"uncompressed block has invalid length";b=new ArrayBuffer(4*U),new Uint8Array(b).set(new Uint8Array(e,t,4*U));var T=new Float32Array(b);y.rawData=T,t+=4*U}else if(1===y.encoding){var M=Math.ceil(y.numValidPixels*y.bitsPerPixel/8),V=Math.ceil(M/4);b=new ArrayBuffer(4*V),new Uint8Array(b).set(new Uint8Array(e,t,M)),y.stuffedData=new Uint32Array(b),t+=M}}else t++}return a.eofOffset=t,a},s=function(e,t,i,a,n,r,s){var l,o,f,u=(1<<t)-1,c=0,d=0,h=Math.ceil((s-a)/n),m=4*e.length-Math.ceil(t*i/8);for(e[e.length-1]<<=8*m,l=0;l<i;l++){if(0===d&&(f=e[c++],d=32),d>=t)o=f>>>d-t&u,d-=t;else{var g=t-d;o=(f&u)<<g&u,o+=(f=e[c++])>>>(d=32-g)}r[l]=o<h?a+o*n:s}return r},t),w=(l=function(e,t,i,a,n,r,s,l){var o,f,u,c,d,h=(1<<i)-1,m=0,g=0,p=4*e.length-Math.ceil(i*a/8);if(e[e.length-1]<<=8*p,n)for(o=0;o<a;o++)0===g&&(u=e[m++],g=32),g>=i?(f=u>>>g-i&h,g-=i):(f=(u&h)<<(c=i-g)&h,f+=(u=e[m++])>>>(g=32-c)),t[o]=n[f];else for(d=Math.ceil((l-r)/s),o=0;o<a;o++)0===g&&(u=e[m++],g=32),g>=i?(f=u>>>g-i&h,g-=i):(f=(u&h)<<(c=i-g)&h,f+=(u=e[m++])>>>(g=32-c)),t[o]=f<d?r+f*s:l},o=function(e,t,i,a,n,r){var s,l=(1<<t)-1,o=0,f=0,u=0,c=0,d=0,h=[],m=4*e.length-Math.ceil(t*i/8);e[e.length-1]<<=8*m;var g=Math.ceil((r-a)/n);for(f=0;f<i;f++)0===c&&(s=e[o++],c=32),c>=t?(d=s>>>c-t&l,c-=t):(d=(s&l)<<(u=t-c)&l,d+=(s=e[o++])>>>(c=32-u)),h[f]=d<g?a+d*n:r;return h.unshift(a),h},f=function(e,t,i,a,n,r,s,l){var o,f,u,c,d=(1<<i)-1,h=0,m=0,g=0;if(n)for(o=0;o<a;o++)0===m&&(u=e[h++],m=32,g=0),m>=i?(f=u>>>g&d,m-=i,g+=i):(f=u>>>g&d,m=32-(c=i-m),f|=((u=e[h++])&(1<<c)-1)<<i-c,g=c),t[o]=n[f];else{var p=Math.ceil((l-r)/s);for(o=0;o<a;o++)0===m&&(u=e[h++],m=32,g=0),m>=i?(f=u>>>g&d,m-=i,g+=i):(f=u>>>g&d,m=32-(c=i-m),f|=((u=e[h++])&(1<<c)-1)<<i-c,g=c),t[o]=f<p?r+f*s:l}return t},u=function(e,t,i,a,n,r){var s,l=(1<<t)-1,o=0,f=0,u=0,c=0,d=0,h=0,m=[],g=Math.ceil((r-a)/n);for(f=0;f<i;f++)0===c&&(s=e[o++],c=32,h=0),c>=t?(d=s>>>h&l,c-=t,h+=t):(d=s>>>h&l,c=32-(u=t-c),d|=((s=e[o++])&(1<<u)-1)<<t-u,h=u),m[f]=d<g?a+d*n:r;return m.unshift(a),m},c=function(e,t,i,a){var n,r,s,l,o=(1<<i)-1,f=0,u=0,c=4*e.length-Math.ceil(i*a/8);for(e[e.length-1]<<=8*c,n=0;n<a;n++)0===u&&(s=e[f++],u=32),u>=i?(r=s>>>u-i&o,u-=i):(r=(s&o)<<(l=i-u)&o,r+=(s=e[f++])>>>(u=32-l)),t[n]=r;return t},d=function(e,t,i,a){var n,r,s,l,o=(1<<i)-1,f=0,u=0,c=0;for(n=0;n<a;n++)0===u&&(s=e[f++],u=32,c=0),u>=i?(r=s>>>c&o,u-=i,c+=i):(r=s>>>c&o,u=32-(l=i-u),r|=((s=e[f++])&(1<<l)-1)<<i-l,c=l),t[n]=r;return t},h={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(e){for(var t=65535,i=65535,a=e.length,n=Math.floor(a/2),r=0;n;){var s=n>=359?359:n;n-=s;do{t+=e[r++]<<8,i+=t+=e[r++]}while(--s);t=(65535&t)+(t>>>16),i=(65535&i)+(i>>>16)}return 1&a&&(i+=t+=e[r]<<8),((i=(65535&i)+(i>>>16))<<16|(t=(65535&t)+(t>>>16)))>>>0},readHeaderInfo:function(e,t){var i=t.ptr,a=new Uint8Array(e,i,6),n={};if(n.fileIdentifierString=String.fromCharCode.apply(null,a),0!==n.fileIdentifierString.lastIndexOf("Lerc2",0))throw"Unexpected file identifier string (expect Lerc2 ): "+n.fileIdentifierString;i+=6;var r,s=new DataView(e,i,8),l=s.getInt32(0,!0);if(n.fileVersion=l,i+=4,l>=3&&(n.checksum=s.getUint32(4,!0),i+=4),s=new DataView(e,i,12),n.height=s.getUint32(0,!0),n.width=s.getUint32(4,!0),i+=8,l>=4?(n.numDims=s.getUint32(8,!0),i+=4):n.numDims=1,s=new DataView(e,i,40),n.numValidPixel=s.getUint32(0,!0),n.microBlockSize=s.getInt32(4,!0),n.blobSize=s.getInt32(8,!0),n.imageType=s.getInt32(12,!0),n.maxZError=s.getFloat64(16,!0),n.zMin=s.getFloat64(24,!0),n.zMax=s.getFloat64(32,!0),i+=40,t.headerInfo=n,t.ptr=i,l>=3&&(r=l>=4?52:48,this.computeChecksumFletcher32(new Uint8Array(e,i-r,n.blobSize-14))!==n.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(e,t){var i=t.headerInfo,a=this.getDataTypeArray(i.imageType),n=i.numDims*this.getDataTypeSize(i.imageType),r=this.readSubArray(e,t.ptr,a,n),s=this.readSubArray(e,t.ptr+n,a,n);t.ptr+=2*n;var l,o=!0;for(l=0;l<i.numDims;l++)if(r[l]!==s[l]){o=!1;break}return i.minValues=r,i.maxValues=s,o},readSubArray:function(e,t,i,a){var n;if(i===Uint8Array)n=new Uint8Array(e,t,a);else{var r=new ArrayBuffer(a);new Uint8Array(r).set(new Uint8Array(e,t,a)),n=new i(r)}return n},readMask:function(e,t){var i,a,n=t.ptr,r=t.headerInfo,s=r.width*r.height,l=r.numValidPixel,o=new DataView(e,n,4),f={};if(f.numBytes=o.getUint32(0,!0),n+=4,(0===l||s===l)&&0!==f.numBytes)throw"invalid mask";if(0===l)i=new Uint8Array(Math.ceil(s/8)),f.bitset=i,a=new Uint8Array(s),t.pixels.resultMask=a,n+=f.numBytes;else if(f.numBytes>0){i=new Uint8Array(Math.ceil(s/8));var u=(o=new DataView(e,n,f.numBytes)).getInt16(0,!0),c=2,d=0,h=0;do{if(u>0)for(;u--;)i[d++]=o.getUint8(c++);else for(h=o.getUint8(c++),u=-u;u--;)i[d++]=h;u=o.getInt16(c,!0),c+=2}while(c<f.numBytes);if(-32768!==u||d<i.length)throw"Unexpected end of mask RLE encoding";a=new Uint8Array(s);var m=0,g=0;for(g=0;g<s;g++)7&g?(m=i[g>>3],m<<=7&g):m=i[g>>3],128&m&&(a[g]=1);t.pixels.resultMask=a,f.bitset=i,n+=f.numBytes}return t.ptr=n,t.mask=f,!0},readDataOneSweep:function(e,t,i){var a,n=t.ptr,r=t.headerInfo,s=r.numDims,l=r.width*r.height,o=r.imageType,f=r.numValidPixel*h.getDataTypeSize(o)*s,u=t.pixels.resultMask;if(i===Uint8Array)a=new Uint8Array(e,n,f);else{var c=new ArrayBuffer(f);new Uint8Array(c).set(new Uint8Array(e,n,f)),a=new i(c)}if(a.length===l*s)t.pixels.resultPixels=a;else{t.pixels.resultPixels=new i(l*s);var d=0,m=0,g=0,p=0;if(s>1)for(g=0;g<s;g++)for(p=g*l,m=0;m<l;m++)u[m]&&(t.pixels.resultPixels[p+m]=a[d++]);else for(m=0;m<l;m++)u[m]&&(t.pixels.resultPixels[m]=a[d++])}return n+=f,t.ptr=n,!0},readHuffmanTree:function(e,t){var i=this.HUFFMAN_LUT_BITS_MAX,a=new DataView(e,t.ptr,16);if(t.ptr+=16,a.getInt32(0,!0)<2)throw"unsupported Huffman version";var n=a.getInt32(4,!0),r=a.getInt32(8,!0),s=a.getInt32(12,!0);if(r>=s)return!1;var l=new Uint32Array(s-r);h.decodeBits(e,t,l);var o,f,u,c,d=[];for(o=r;o<s;o++)d[f=o-(o<n?0:n)]={first:l[o-r],second:null};var g=e.byteLength-t.ptr,p=Math.ceil(g/4),x=new ArrayBuffer(4*p);new Uint8Array(x).set(new Uint8Array(e,t.ptr,g));var w,k=new Uint32Array(x),y=0,I=0;for(w=k[0],o=r;o<s;o++)(c=d[f=o-(o<n?0:n)].first)>0&&(d[f].second=w<<y>>>32-c,32-y>=c?32===(y+=c)&&(y=0,w=k[++I]):(y+=c-32,w=k[++I],d[f].second|=w>>>32-y));var b=0,U=0,T=new m;for(o=0;o<d.length;o++)void 0!==d[o]&&(b=Math.max(b,d[o].first));U=b>=i?i:b,b>=30&&console.log("WARning, large NUM LUT BITS IS "+b);var M,V,v,A,B,D=[];for(o=r;o<s;o++)if((c=d[f=o-(o<n?0:n)].first)>0)if(M=[c,f],c<=U)for(V=d[f].second<<U-c,v=1<<U-c,u=0;u<v;u++)D[V|u]=M;else for(V=d[f].second,B=T,A=c-1;A>=0;A--)V>>>A&1?(B.right||(B.right=new m),B=B.right):(B.left||(B.left=new m),B=B.left),0!==A||B.val||(B.val=M[1]);return{decodeLut:D,numBitsLUTQick:U,numBitsLUT:b,tree:T,stuffedData:k,srcPtr:I,bitPos:y}},readHuffman:function(e,t,i){var a,n,r,s,l,o,f,u,c,d=t.headerInfo,h=d.numDims,m=t.headerInfo.height,g=t.headerInfo.width,p=g*m,x=this.readHuffmanTree(e,t),w=x.decodeLut,k=x.tree,y=x.stuffedData,I=x.srcPtr,b=x.bitPos,U=x.numBitsLUTQick,T=x.numBitsLUT,M=0===t.headerInfo.imageType?128:0,V=t.pixels.resultMask,v=0;b>0&&(I++,b=0);var A,B=y[I],D=1===t.encodeMode,S=new i(p*h),P=S;for(A=0;A<d.numDims;A++){if(h>1&&(P=new i(S.buffer,p*A,p),v=0),t.headerInfo.numValidPixel===g*m)for(u=0,o=0;o<m;o++)for(f=0;f<g;f++,u++){if(n=0,l=s=B<<b>>>32-U,32-b<U&&(l=s|=y[I+1]>>>64-b-U),w[l])n=w[l][1],b+=w[l][0];else for(l=s=B<<b>>>32-T,32-b<T&&(l=s|=y[I+1]>>>64-b-T),a=k,c=0;c<T;c++)if(!(a=s>>>T-c-1&1?a.right:a.left).left&&!a.right){n=a.val,b=b+c+1;break}b>=32&&(b-=32,B=y[++I]),r=n-M,D?(r+=f>0?v:o>0?P[u-g]:v,r&=255,P[u]=r,v=r):P[u]=r}else for(u=0,o=0;o<m;o++)for(f=0;f<g;f++,u++)if(V[u]){if(n=0,l=s=B<<b>>>32-U,32-b<U&&(l=s|=y[I+1]>>>64-b-U),w[l])n=w[l][1],b+=w[l][0];else for(l=s=B<<b>>>32-T,32-b<T&&(l=s|=y[I+1]>>>64-b-T),a=k,c=0;c<T;c++)if(!(a=s>>>T-c-1&1?a.right:a.left).left&&!a.right){n=a.val,b=b+c+1;break}b>=32&&(b-=32,B=y[++I]),r=n-M,D?(f>0&&V[u-1]?r+=v:o>0&&V[u-g]?r+=P[u-g]:r+=v,r&=255,P[u]=r,v=r):P[u]=r}t.ptr=t.ptr+4*(I+1)+(b>0?4:0)}t.pixels.resultPixels=S},decodeBits:function(e,t,i,a,n){var r=t.headerInfo,s=r.fileVersion,h=0,m=new DataView(e,t.ptr,5),g=m.getUint8(0);h++;var p=g>>6,x=0===p?4:3-p,w=(32&g)>0,k=31&g,y=0;if(1===x)y=m.getUint8(h),h++;else if(2===x)y=m.getUint16(h,!0),h+=2;else{if(4!==x)throw"Invalid valid pixel count type";y=m.getUint32(h,!0),h+=4}var I,b,U,T,M,V,v,A,B,D=2*r.maxZError,S=r.numDims>1?r.maxValues[n]:r.zMax;if(w){for(t.counter.lut++,A=m.getUint8(h),h++,T=Math.ceil((A-1)*k/8),M=Math.ceil(T/4),b=new ArrayBuffer(4*M),U=new Uint8Array(b),t.ptr+=h,U.set(new Uint8Array(e,t.ptr,T)),v=new Uint32Array(b),t.ptr+=T,B=0;A-1>>>B;)B++;T=Math.ceil(y*B/8),M=Math.ceil(T/4),b=new ArrayBuffer(4*M),(U=new Uint8Array(b)).set(new Uint8Array(e,t.ptr,T)),I=new Uint32Array(b),t.ptr+=T,V=s>=3?u(v,k,A-1,a,D,S):o(v,k,A-1,a,D,S),s>=3?f(I,i,B,y,V):l(I,i,B,y,V)}else t.counter.bitstuffer++,B=k,t.ptr+=h,B>0&&(T=Math.ceil(y*B/8),M=Math.ceil(T/4),b=new ArrayBuffer(4*M),(U=new Uint8Array(b)).set(new Uint8Array(e,t.ptr,T)),I=new Uint32Array(b),t.ptr+=T,s>=3?null==a?d(I,i,B,y):f(I,i,B,y,!1,a,D,S):null==a?c(I,i,B,y):l(I,i,B,y,!1,a,D,S))},readTiles:function(e,t,i){var a=t.headerInfo,n=a.width,r=a.height,s=a.microBlockSize,l=a.imageType,o=h.getDataTypeSize(l),f=Math.ceil(n/s),u=Math.ceil(r/s);t.pixels.numBlocksY=u,t.pixels.numBlocksX=f,t.pixels.ptr=0;var c,d,m,g,p,x,w,k,y=0,I=0,b=0,U=0,T=0,M=0,V=0,v=0,A=0,B=0,D=0,S=0,P=0,E=0,C=0,F=new i(s*s),N=r%s||s,O=n%s||s,R=a.numDims,L=t.pixels.resultMask,z=t.pixels.resultPixels;for(b=0;b<u;b++)for(T=b!==u-1?s:N,U=0;U<f;U++)for(B=b*n*s+U*s,D=n-(M=U!==f-1?s:O),k=0;k<R;k++){if(R>1&&(z=new i(t.pixels.resultPixels.buffer,n*r*k*o,n*r)),V=e.byteLength-t.ptr,d={},C=0,C++,A=(v=(c=new DataView(e,t.ptr,Math.min(10,V))).getUint8(0))>>6&255,(v>>2&15)!=(U*s>>3&15))throw"integrity issue";if((p=3&v)>3)throw t.ptr+=C,"Invalid block encoding ("+p+")";if(2!==p)if(0===p){if(t.counter.uncompressed++,t.ptr+=C,S=(S=T*M*o)<(P=e.byteLength-t.ptr)?S:P,m=new ArrayBuffer(S%o==0?S:S+o-S%o),new Uint8Array(m).set(new Uint8Array(e,t.ptr,S)),g=new i(m),E=0,L)for(y=0;y<T;y++){for(I=0;I<M;I++)L[B]&&(z[B]=g[E++]),B++;B+=D}else for(y=0;y<T;y++){for(I=0;I<M;I++)z[B++]=g[E++];B+=D}t.ptr+=E*o}else if(x=h.getDataTypeUsed(l,A),w=h.getOnePixel(d,C,x,c),C+=h.getDataTypeSize(x),3===p)if(t.ptr+=C,t.counter.constantoffset++,L)for(y=0;y<T;y++){for(I=0;I<M;I++)L[B]&&(z[B]=w),B++;B+=D}else for(y=0;y<T;y++){for(I=0;I<M;I++)z[B++]=w;B+=D}else if(t.ptr+=C,h.decodeBits(e,t,F,w,k),C=0,L)for(y=0;y<T;y++){for(I=0;I<M;I++)L[B]&&(z[B]=F[C++]),B++;B+=D}else for(y=0;y<T;y++){for(I=0;I<M;I++)z[B++]=F[C++];B+=D}else t.counter.constant++,t.ptr+=C}},formatFileInfo:function(e){return{fileIdentifierString:e.headerInfo.fileIdentifierString,fileVersion:e.headerInfo.fileVersion,imageType:e.headerInfo.imageType,height:e.headerInfo.height,width:e.headerInfo.width,numValidPixel:e.headerInfo.numValidPixel,microBlockSize:e.headerInfo.microBlockSize,blobSize:e.headerInfo.blobSize,maxZError:e.headerInfo.maxZError,pixelType:h.getPixelType(e.headerInfo.imageType),eofOffset:e.eofOffset,mask:e.mask?{numBytes:e.mask.numBytes}:null,pixels:{numBlocksX:e.pixels.numBlocksX,numBlocksY:e.pixels.numBlocksY,maxValue:e.headerInfo.zMax,minValue:e.headerInfo.zMin,noDataValue:e.noDataValue}}},constructConstantSurface:function(e){var t=e.headerInfo.zMax,i=e.headerInfo.numDims,a=e.headerInfo.height*e.headerInfo.width,n=a*i,r=0,s=0,l=0,o=e.pixels.resultMask;if(o)if(i>1)for(r=0;r<i;r++)for(l=r*a,s=0;s<a;s++)o[s]&&(e.pixels.resultPixels[l+s]=t);else for(s=0;s<a;s++)o[s]&&(e.pixels.resultPixels[s]=t);else if(e.pixels.resultPixels.fill)e.pixels.resultPixels.fill(t);else for(s=0;s<n;s++)e.pixels.resultPixels[s]=t},getDataTypeArray:function(e){var t;switch(e){case 0:t=Int8Array;break;case 1:t=Uint8Array;break;case 2:t=Int16Array;break;case 3:t=Uint16Array;break;case 4:t=Int32Array;break;case 5:t=Uint32Array;break;default:t=Float32Array;break;case 7:t=Float64Array}return t},getPixelType:function(e){var t;switch(e){case 0:t="S8";break;case 1:t="U8";break;case 2:t="S16";break;case 3:t="U16";break;case 4:t="S32";break;case 5:t="U32";break;default:t="F32";break;case 7:t="F64"}return t},isValidPixelValue:function(e,t){if(null==t)return!1;var i;switch(e){case 0:i=t>=-128&&t<=127;break;case 1:i=t>=0&&t<=255;break;case 2:i=t>=-32768&&t<=32767;break;case 3:i=t>=0&&t<=65536;break;case 4:i=t>=-2147483648&&t<=2147483647;break;case 5:i=t>=0&&t<=4294967296;break;case 6:i=t>=-34027999387901484e22&&t<=34027999387901484e22;break;case 7:i=t>=5e-324&&t<=17976931348623157e292;break;default:i=!1}return i},getDataTypeSize:function(e){var t=0;switch(e){case 0:case 1:t=1;break;case 2:case 3:t=2;break;case 4:case 5:case 6:t=4;break;case 7:t=8;break;default:t=e}return t},getDataTypeUsed:function(e,t){var i=e;switch(e){case 2:case 4:i=e-t;break;case 3:case 5:i=e-2*t;break;case 6:i=0===t?e:1===t?2:1;break;case 7:i=0===t?e:e-2*t+1;break;default:i=e}return i},getOnePixel:function(e,t,i,a){var n=0;switch(i){case 0:n=a.getInt8(t);break;case 1:n=a.getUint8(t);break;case 2:n=a.getInt16(t,!0);break;case 3:n=a.getUint16(t,!0);break;case 4:n=a.getInt32(t,!0);break;case 5:n=a.getUInt32(t,!0);break;case 6:n=a.getFloat32(t,!0);break;case 7:n=a.getFloat64(t,!0);break;default:throw"the decoder does not understand this pixel type"}return n}},m=function(e,t,i){this.val=e,this.left=t,this.right=i},{decode:function(e,t){var i=(t=t||{}).noDataValue,a=0,n={};n.ptr=t.inputOffset||0,n.pixels={},h.readHeaderInfo(e,n);var r=n.headerInfo,s=r.fileVersion,l=h.getDataTypeArray(r.imageType);h.readMask(e,n),r.numValidPixel===r.width*r.height||n.pixels.resultMask||(n.pixels.resultMask=t.maskData);var o,f=r.width*r.height;if(n.pixels.resultPixels=new l(f*r.numDims),n.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},0!==r.numValidPixel)if(r.zMax===r.zMin)h.constructConstantSurface(n);else if(s>=4&&h.checkMinMaxRanges(e,n))h.constructConstantSurface(n);else{var u=new DataView(e,n.ptr,2),c=u.getUint8(0);if(n.ptr++,c)h.readDataOneSweep(e,n,l);else if(s>1&&r.imageType<=1&&Math.abs(r.maxZError-.5)<1e-5){var d=u.getUint8(1);if(n.ptr++,n.encodeMode=d,d>2||s<4&&d>1)throw"Invalid Huffman flag "+d;d?h.readHuffman(e,n,l):h.readTiles(e,n,l)}else h.readTiles(e,n,l)}n.eofOffset=n.ptr,t.inputOffset?(o=n.headerInfo.blobSize+t.inputOffset-n.ptr,Math.abs(o)>=1&&(n.eofOffset=t.inputOffset+n.headerInfo.blobSize)):(o=n.headerInfo.blobSize-n.ptr,Math.abs(o)>=1&&(n.eofOffset=n.headerInfo.blobSize));var m={width:r.width,height:r.height,pixelData:n.pixels.resultPixels,minValue:r.zMin,maxValue:r.zMax,validPixelCount:r.numValidPixel,dimCount:r.numDims,dimStats:{minValues:r.minValues,maxValues:r.maxValues},maskData:n.pixels.resultMask};if(n.pixels.resultMask&&h.isValidPixelValue(r.imageType,i)){var g=n.pixels.resultMask;for(a=0;a<f;a++)g[a]||(m.pixelData[a]=i);m.noDataValue=i}return n.noDataValue=i,t.returnFileInfo&&(m.fileInfo=h.formatFileInfo(n)),m},getBandCount:function(e){for(var t=0,i=0,a={ptr:0,pixels:{}};i<e.byteLength-58;)h.readHeaderInfo(e,a),i+=a.headerInfo.blobSize,t++,a.ptr=i;return t}}),k=(g=new ArrayBuffer(4),p=new Uint8Array(g),new Uint32Array(g)[0]=1,1===p[0]),y={decode:function(e,t){if(!k)throw"Big endian system is not supported.";var i,a,n=(t=t||{}).inputOffset||0,r=new Uint8Array(e,n,10),s=String.fromCharCode.apply(null,r);if("CntZImage"===s.trim())i=x,a=1;else{if("Lerc2"!==s.substring(0,5))throw"Unexpected file identifier string: "+s;i=w,a=2}for(var l,o,f,u,c,d,h=0,m=e.byteLength-10,g=[],p={width:0,height:0,pixels:[],pixelType:t.pixelType,mask:null,statistics:[]};n<m;){var y=i.decode(e,{inputOffset:n,encodedMaskData:l,maskData:f,returnMask:0===h,returnEncodedMask:0===h,returnFileInfo:!0,pixelType:t.pixelType||null,noDataValue:t.noDataValue||null});n=y.fileInfo.eofOffset,0===h&&(l=y.encodedMaskData,f=y.maskData,p.width=y.width,p.height=y.height,p.dimCount=y.dimCount||1,p.pixelType=y.pixelType||y.fileInfo.pixelType,p.mask=y.maskData),a>1&&y.fileInfo.mask&&y.fileInfo.mask.numBytes>0&&g.push(y.maskData),h++,p.pixels.push(y.pixelData),p.statistics.push({minValue:y.minValue,maxValue:y.maxValue,noDataValue:y.noDataValue,dimStats:y.dimStats})}if(a>1&&g.length>1){for(d=p.width*p.height,p.bandMasks=g,(f=new Uint8Array(d)).set(g[0]),u=1;u<g.length;u++)for(o=g[u],c=0;c<d;c++)f[c]=f[c]&o[c];p.maskData=f}return p}};e.exports?e.exports=y:this.Lerc=y}()}));return u((function(t,i){if(t.encoding===x.LERC){let e;try{e=U.decode(t.heightmap)}catch(e){throw new n.RuntimeError(e)}if(e.statistics[0].minValue===Number.MAX_VALUE)throw new n.RuntimeError("Invalid tile data");t.heightmap=e.pixels[0],t.width=e.width,t.height=e.height}t.ellipsoid=e.Ellipsoid.clone(t.ellipsoid),t.rectangle=e.Rectangle.clone(t.rectangle);const a=w.computeVertices(t),r=a.vertices;return i.push(r.buffer),{vertices:r.buffer,numberOfAttributes:a.encoding.stride,minimumHeight:a.minimumHeight,maximumHeight:a.maximumHeight,gridWidth:t.width,gridHeight:t.height,boundingSphere3D:a.boundingSphere3D,orientedBoundingBox:a.orientedBoundingBox,occludeePointInScaledSpace:a.occludeePointInScaledSpace,encoding:a.encoding,westIndicesSouthToNorth:a.westIndicesSouthToNorth,southIndicesEastToWest:a.southIndicesEastToWest,eastIndicesNorthToSouth:a.eastIndicesNorthToSouth,northIndicesWestToEast:a.northIndicesWestToEast}}))}));
1
+ /**
2
+ * @license
3
+ * Cesium - https://github.com/CesiumGS/cesium
4
+ * Version 1.109.3
5
+ *
6
+ * Copyright 2011-2022 Cesium Contributors
7
+ *
8
+ * Licensed under the Apache License, Version 2.0 (the "License");
9
+ * you may not use this file except in compliance with the License.
10
+ * You may obtain a copy of the License at
11
+ *
12
+ * http://www.apache.org/licenses/LICENSE-2.0
13
+ *
14
+ * Unless required by applicable law or agreed to in writing, software
15
+ * distributed under the License is distributed on an "AS IS" BASIS,
16
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
+ * See the License for the specific language governing permissions and
18
+ * limitations under the License.
19
+ *
20
+ * Columbus View (Pat. Pend.)
21
+ *
22
+ * Portions licensed separately.
23
+ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
24
+ */
25
+
26
+ import {
27
+ EllipsoidalOccluder_default,
28
+ TerrainEncoding_default
29
+ } from "./chunk-TFC6TZ3S.js";
30
+ import {
31
+ createTaskProcessorWorker_default
32
+ } from "./chunk-A4JVFBQ3.js";
33
+ import {
34
+ WebMercatorProjection_default
35
+ } from "./chunk-HQF437NJ.js";
36
+ import {
37
+ OrientedBoundingBox_default
38
+ } from "./chunk-Z24VKNDO.js";
39
+ import "./chunk-O5AMBQ36.js";
40
+ import "./chunk-RP2A7BR5.js";
41
+ import {
42
+ AxisAlignedBoundingBox_default
43
+ } from "./chunk-2R5O53JW.js";
44
+ import "./chunk-MYZB7C4T.js";
45
+ import "./chunk-OYFCF4PL.js";
46
+ import {
47
+ BoundingSphere_default,
48
+ Transforms_default
49
+ } from "./chunk-PFQBCKBM.js";
50
+ import "./chunk-QJ3DFBH3.js";
51
+ import {
52
+ Cartesian2_default,
53
+ Matrix4_default,
54
+ Rectangle_default
55
+ } from "./chunk-DUHWWBQQ.js";
56
+ import "./chunk-LLUNNUJV.js";
57
+ import {
58
+ Cartesian3_default,
59
+ Ellipsoid_default
60
+ } from "./chunk-PCJWUS4M.js";
61
+ import {
62
+ Math_default
63
+ } from "./chunk-N3JIFFX2.js";
64
+ import "./chunk-AHKEZ2OE.js";
65
+ import {
66
+ RuntimeError_default
67
+ } from "./chunk-ABADGKYE.js";
68
+ import {
69
+ defaultValue_default
70
+ } from "./chunk-WXTV4ATB.js";
71
+ import {
72
+ DeveloperError_default
73
+ } from "./chunk-4MFFIWUA.js";
74
+ import {
75
+ __commonJS,
76
+ __toESM,
77
+ defined_default
78
+ } from "./chunk-6BTKZDRG.js";
79
+
80
+ // node_modules/lerc/LercDecode.js
81
+ var require_LercDecode = __commonJS({
82
+ "node_modules/lerc/LercDecode.js"(exports, module) {
83
+ /* 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 */
84
+ (function() {
85
+ var LercDecode = function() {
86
+ var CntZImage = {};
87
+ CntZImage.defaultNoDataValue = -34027999387901484e22;
88
+ CntZImage.decode = function(input, options) {
89
+ options = options || {};
90
+ var skipMask = options.encodedMaskData || options.encodedMaskData === null;
91
+ var parsedData = parse(input, options.inputOffset || 0, skipMask);
92
+ var noDataValue = options.noDataValue !== null ? options.noDataValue : CntZImage.defaultNoDataValue;
93
+ var uncompressedData = uncompressPixelValues(
94
+ parsedData,
95
+ options.pixelType || Float32Array,
96
+ options.encodedMaskData,
97
+ noDataValue,
98
+ options.returnMask
99
+ );
100
+ var result = {
101
+ width: parsedData.width,
102
+ height: parsedData.height,
103
+ pixelData: uncompressedData.resultPixels,
104
+ minValue: uncompressedData.minValue,
105
+ maxValue: parsedData.pixels.maxValue,
106
+ noDataValue
107
+ };
108
+ if (uncompressedData.resultMask) {
109
+ result.maskData = uncompressedData.resultMask;
110
+ }
111
+ if (options.returnEncodedMask && parsedData.mask) {
112
+ result.encodedMaskData = parsedData.mask.bitset ? parsedData.mask.bitset : null;
113
+ }
114
+ if (options.returnFileInfo) {
115
+ result.fileInfo = formatFileInfo(parsedData);
116
+ if (options.computeUsedBitDepths) {
117
+ result.fileInfo.bitDepths = computeUsedBitDepths(parsedData);
118
+ }
119
+ }
120
+ return result;
121
+ };
122
+ var uncompressPixelValues = function(data, TypedArrayClass, maskBitset, noDataValue, storeDecodedMask) {
123
+ var blockIdx = 0;
124
+ var numX = data.pixels.numBlocksX;
125
+ var numY = data.pixels.numBlocksY;
126
+ var blockWidth = Math.floor(data.width / numX);
127
+ var blockHeight = Math.floor(data.height / numY);
128
+ var scale = 2 * data.maxZError;
129
+ var minValue = Number.MAX_VALUE, currentValue;
130
+ maskBitset = maskBitset || (data.mask ? data.mask.bitset : null);
131
+ var resultPixels, resultMask;
132
+ resultPixels = new TypedArrayClass(data.width * data.height);
133
+ if (storeDecodedMask && maskBitset) {
134
+ resultMask = new Uint8Array(data.width * data.height);
135
+ }
136
+ var blockDataBuffer = new Float32Array(blockWidth * blockHeight);
137
+ var xx, yy;
138
+ for (var y = 0; y <= numY; y++) {
139
+ var thisBlockHeight = y !== numY ? blockHeight : data.height % numY;
140
+ if (thisBlockHeight === 0) {
141
+ continue;
142
+ }
143
+ for (var x = 0; x <= numX; x++) {
144
+ var thisBlockWidth = x !== numX ? blockWidth : data.width % numX;
145
+ if (thisBlockWidth === 0) {
146
+ continue;
147
+ }
148
+ var outPtr = y * data.width * blockHeight + x * blockWidth;
149
+ var outStride = data.width - thisBlockWidth;
150
+ var block = data.pixels.blocks[blockIdx];
151
+ var blockData, blockPtr, constValue;
152
+ if (block.encoding < 2) {
153
+ if (block.encoding === 0) {
154
+ blockData = block.rawData;
155
+ } else {
156
+ unstuff(block.stuffedData, block.bitsPerPixel, block.numValidPixels, block.offset, scale, blockDataBuffer, data.pixels.maxValue);
157
+ blockData = blockDataBuffer;
158
+ }
159
+ blockPtr = 0;
160
+ } else if (block.encoding === 2) {
161
+ constValue = 0;
162
+ } else {
163
+ constValue = block.offset;
164
+ }
165
+ var maskByte;
166
+ if (maskBitset) {
167
+ for (yy = 0; yy < thisBlockHeight; yy++) {
168
+ if (outPtr & 7) {
169
+ maskByte = maskBitset[outPtr >> 3];
170
+ maskByte <<= outPtr & 7;
171
+ }
172
+ for (xx = 0; xx < thisBlockWidth; xx++) {
173
+ if (!(outPtr & 7)) {
174
+ maskByte = maskBitset[outPtr >> 3];
175
+ }
176
+ if (maskByte & 128) {
177
+ if (resultMask) {
178
+ resultMask[outPtr] = 1;
179
+ }
180
+ currentValue = block.encoding < 2 ? blockData[blockPtr++] : constValue;
181
+ minValue = minValue > currentValue ? currentValue : minValue;
182
+ resultPixels[outPtr++] = currentValue;
183
+ } else {
184
+ if (resultMask) {
185
+ resultMask[outPtr] = 0;
186
+ }
187
+ resultPixels[outPtr++] = noDataValue;
188
+ }
189
+ maskByte <<= 1;
190
+ }
191
+ outPtr += outStride;
192
+ }
193
+ } else {
194
+ if (block.encoding < 2) {
195
+ for (yy = 0; yy < thisBlockHeight; yy++) {
196
+ for (xx = 0; xx < thisBlockWidth; xx++) {
197
+ currentValue = blockData[blockPtr++];
198
+ minValue = minValue > currentValue ? currentValue : minValue;
199
+ resultPixels[outPtr++] = currentValue;
200
+ }
201
+ outPtr += outStride;
202
+ }
203
+ } else {
204
+ minValue = minValue > constValue ? constValue : minValue;
205
+ for (yy = 0; yy < thisBlockHeight; yy++) {
206
+ for (xx = 0; xx < thisBlockWidth; xx++) {
207
+ resultPixels[outPtr++] = constValue;
208
+ }
209
+ outPtr += outStride;
210
+ }
211
+ }
212
+ }
213
+ if (block.encoding === 1 && blockPtr !== block.numValidPixels) {
214
+ throw "Block and Mask do not match";
215
+ }
216
+ blockIdx++;
217
+ }
218
+ }
219
+ return {
220
+ resultPixels,
221
+ resultMask,
222
+ minValue
223
+ };
224
+ };
225
+ var formatFileInfo = function(data) {
226
+ return {
227
+ "fileIdentifierString": data.fileIdentifierString,
228
+ "fileVersion": data.fileVersion,
229
+ "imageType": data.imageType,
230
+ "height": data.height,
231
+ "width": data.width,
232
+ "maxZError": data.maxZError,
233
+ "eofOffset": data.eofOffset,
234
+ "mask": data.mask ? {
235
+ "numBlocksX": data.mask.numBlocksX,
236
+ "numBlocksY": data.mask.numBlocksY,
237
+ "numBytes": data.mask.numBytes,
238
+ "maxValue": data.mask.maxValue
239
+ } : null,
240
+ "pixels": {
241
+ "numBlocksX": data.pixels.numBlocksX,
242
+ "numBlocksY": data.pixels.numBlocksY,
243
+ "numBytes": data.pixels.numBytes,
244
+ "maxValue": data.pixels.maxValue,
245
+ "noDataValue": data.noDataValue
246
+ }
247
+ };
248
+ };
249
+ var computeUsedBitDepths = function(data) {
250
+ var numBlocks = data.pixels.numBlocksX * data.pixels.numBlocksY;
251
+ var bitDepths = {};
252
+ for (var i = 0; i < numBlocks; i++) {
253
+ var block = data.pixels.blocks[i];
254
+ if (block.encoding === 0) {
255
+ bitDepths.float32 = true;
256
+ } else if (block.encoding === 1) {
257
+ bitDepths[block.bitsPerPixel] = true;
258
+ } else {
259
+ bitDepths[0] = true;
260
+ }
261
+ }
262
+ return Object.keys(bitDepths);
263
+ };
264
+ var parse = function(input, fp, skipMask) {
265
+ var data = {};
266
+ var fileIdView = new Uint8Array(input, fp, 10);
267
+ data.fileIdentifierString = String.fromCharCode.apply(null, fileIdView);
268
+ if (data.fileIdentifierString.trim() !== "CntZImage") {
269
+ throw "Unexpected file identifier string: " + data.fileIdentifierString;
270
+ }
271
+ fp += 10;
272
+ var view = new DataView(input, fp, 24);
273
+ data.fileVersion = view.getInt32(0, true);
274
+ data.imageType = view.getInt32(4, true);
275
+ data.height = view.getUint32(8, true);
276
+ data.width = view.getUint32(12, true);
277
+ data.maxZError = view.getFloat64(16, true);
278
+ fp += 24;
279
+ if (!skipMask) {
280
+ view = new DataView(input, fp, 16);
281
+ data.mask = {};
282
+ data.mask.numBlocksY = view.getUint32(0, true);
283
+ data.mask.numBlocksX = view.getUint32(4, true);
284
+ data.mask.numBytes = view.getUint32(8, true);
285
+ data.mask.maxValue = view.getFloat32(12, true);
286
+ fp += 16;
287
+ if (data.mask.numBytes > 0) {
288
+ var bitset = new Uint8Array(Math.ceil(data.width * data.height / 8));
289
+ view = new DataView(input, fp, data.mask.numBytes);
290
+ var cnt = view.getInt16(0, true);
291
+ var ip = 2, op = 0;
292
+ do {
293
+ if (cnt > 0) {
294
+ while (cnt--) {
295
+ bitset[op++] = view.getUint8(ip++);
296
+ }
297
+ } else {
298
+ var val = view.getUint8(ip++);
299
+ cnt = -cnt;
300
+ while (cnt--) {
301
+ bitset[op++] = val;
302
+ }
303
+ }
304
+ cnt = view.getInt16(ip, true);
305
+ ip += 2;
306
+ } while (ip < data.mask.numBytes);
307
+ if (cnt !== -32768 || op < bitset.length) {
308
+ throw "Unexpected end of mask RLE encoding";
309
+ }
310
+ data.mask.bitset = bitset;
311
+ fp += data.mask.numBytes;
312
+ } else if ((data.mask.numBytes | data.mask.numBlocksY | data.mask.maxValue) === 0) {
313
+ data.mask.bitset = new Uint8Array(Math.ceil(data.width * data.height / 8));
314
+ }
315
+ }
316
+ view = new DataView(input, fp, 16);
317
+ data.pixels = {};
318
+ data.pixels.numBlocksY = view.getUint32(0, true);
319
+ data.pixels.numBlocksX = view.getUint32(4, true);
320
+ data.pixels.numBytes = view.getUint32(8, true);
321
+ data.pixels.maxValue = view.getFloat32(12, true);
322
+ fp += 16;
323
+ var numBlocksX = data.pixels.numBlocksX;
324
+ var numBlocksY = data.pixels.numBlocksY;
325
+ var actualNumBlocksX = numBlocksX + (data.width % numBlocksX > 0 ? 1 : 0);
326
+ var actualNumBlocksY = numBlocksY + (data.height % numBlocksY > 0 ? 1 : 0);
327
+ data.pixels.blocks = new Array(actualNumBlocksX * actualNumBlocksY);
328
+ var blockI = 0;
329
+ for (var blockY = 0; blockY < actualNumBlocksY; blockY++) {
330
+ for (var blockX = 0; blockX < actualNumBlocksX; blockX++) {
331
+ var size = 0;
332
+ var bytesLeft = input.byteLength - fp;
333
+ view = new DataView(input, fp, Math.min(10, bytesLeft));
334
+ var block = {};
335
+ data.pixels.blocks[blockI++] = block;
336
+ var headerByte = view.getUint8(0);
337
+ size++;
338
+ block.encoding = headerByte & 63;
339
+ if (block.encoding > 3) {
340
+ throw "Invalid block encoding (" + block.encoding + ")";
341
+ }
342
+ if (block.encoding === 2) {
343
+ fp++;
344
+ continue;
345
+ }
346
+ if (headerByte !== 0 && headerByte !== 2) {
347
+ headerByte >>= 6;
348
+ block.offsetType = headerByte;
349
+ if (headerByte === 2) {
350
+ block.offset = view.getInt8(1);
351
+ size++;
352
+ } else if (headerByte === 1) {
353
+ block.offset = view.getInt16(1, true);
354
+ size += 2;
355
+ } else if (headerByte === 0) {
356
+ block.offset = view.getFloat32(1, true);
357
+ size += 4;
358
+ } else {
359
+ throw "Invalid block offset type";
360
+ }
361
+ if (block.encoding === 1) {
362
+ headerByte = view.getUint8(size);
363
+ size++;
364
+ block.bitsPerPixel = headerByte & 63;
365
+ headerByte >>= 6;
366
+ block.numValidPixelsType = headerByte;
367
+ if (headerByte === 2) {
368
+ block.numValidPixels = view.getUint8(size);
369
+ size++;
370
+ } else if (headerByte === 1) {
371
+ block.numValidPixels = view.getUint16(size, true);
372
+ size += 2;
373
+ } else if (headerByte === 0) {
374
+ block.numValidPixels = view.getUint32(size, true);
375
+ size += 4;
376
+ } else {
377
+ throw "Invalid valid pixel count type";
378
+ }
379
+ }
380
+ }
381
+ fp += size;
382
+ if (block.encoding === 3) {
383
+ continue;
384
+ }
385
+ var arrayBuf, store8;
386
+ if (block.encoding === 0) {
387
+ var numPixels = (data.pixels.numBytes - 1) / 4;
388
+ if (numPixels !== Math.floor(numPixels)) {
389
+ throw "uncompressed block has invalid length";
390
+ }
391
+ arrayBuf = new ArrayBuffer(numPixels * 4);
392
+ store8 = new Uint8Array(arrayBuf);
393
+ store8.set(new Uint8Array(input, fp, numPixels * 4));
394
+ var rawData = new Float32Array(arrayBuf);
395
+ block.rawData = rawData;
396
+ fp += numPixels * 4;
397
+ } else if (block.encoding === 1) {
398
+ var dataBytes = Math.ceil(block.numValidPixels * block.bitsPerPixel / 8);
399
+ var dataWords = Math.ceil(dataBytes / 4);
400
+ arrayBuf = new ArrayBuffer(dataWords * 4);
401
+ store8 = new Uint8Array(arrayBuf);
402
+ store8.set(new Uint8Array(input, fp, dataBytes));
403
+ block.stuffedData = new Uint32Array(arrayBuf);
404
+ fp += dataBytes;
405
+ }
406
+ }
407
+ }
408
+ data.eofOffset = fp;
409
+ return data;
410
+ };
411
+ var unstuff = function(src, bitsPerPixel, numPixels, offset, scale, dest, maxValue) {
412
+ var bitMask = (1 << bitsPerPixel) - 1;
413
+ var i = 0, o;
414
+ var bitsLeft = 0;
415
+ var n, buffer;
416
+ var nmax = Math.ceil((maxValue - offset) / scale);
417
+ var numInvalidTailBytes = src.length * 4 - Math.ceil(bitsPerPixel * numPixels / 8);
418
+ src[src.length - 1] <<= 8 * numInvalidTailBytes;
419
+ for (o = 0; o < numPixels; o++) {
420
+ if (bitsLeft === 0) {
421
+ buffer = src[i++];
422
+ bitsLeft = 32;
423
+ }
424
+ if (bitsLeft >= bitsPerPixel) {
425
+ n = buffer >>> bitsLeft - bitsPerPixel & bitMask;
426
+ bitsLeft -= bitsPerPixel;
427
+ } else {
428
+ var missingBits = bitsPerPixel - bitsLeft;
429
+ n = (buffer & bitMask) << missingBits & bitMask;
430
+ buffer = src[i++];
431
+ bitsLeft = 32 - missingBits;
432
+ n += buffer >>> bitsLeft;
433
+ }
434
+ dest[o] = n < nmax ? offset + n * scale : maxValue;
435
+ }
436
+ return dest;
437
+ };
438
+ return CntZImage;
439
+ }();
440
+ var Lerc2Decode = function() {
441
+ "use strict";
442
+ var BitStuffer = {
443
+ //methods ending with 2 are for the new byte order used by Lerc2.3 and above.
444
+ //originalUnstuff is used to unpack Huffman code table. code is duplicated to unstuffx for performance reasons.
445
+ unstuff: function(src, dest, bitsPerPixel, numPixels, lutArr, offset, scale, maxValue) {
446
+ var bitMask = (1 << bitsPerPixel) - 1;
447
+ var i = 0, o;
448
+ var bitsLeft = 0;
449
+ var n, buffer, missingBits, nmax;
450
+ var numInvalidTailBytes = src.length * 4 - Math.ceil(bitsPerPixel * numPixels / 8);
451
+ src[src.length - 1] <<= 8 * numInvalidTailBytes;
452
+ if (lutArr) {
453
+ for (o = 0; o < numPixels; o++) {
454
+ if (bitsLeft === 0) {
455
+ buffer = src[i++];
456
+ bitsLeft = 32;
457
+ }
458
+ if (bitsLeft >= bitsPerPixel) {
459
+ n = buffer >>> bitsLeft - bitsPerPixel & bitMask;
460
+ bitsLeft -= bitsPerPixel;
461
+ } else {
462
+ missingBits = bitsPerPixel - bitsLeft;
463
+ n = (buffer & bitMask) << missingBits & bitMask;
464
+ buffer = src[i++];
465
+ bitsLeft = 32 - missingBits;
466
+ n += buffer >>> bitsLeft;
467
+ }
468
+ dest[o] = lutArr[n];
469
+ }
470
+ } else {
471
+ nmax = Math.ceil((maxValue - offset) / scale);
472
+ for (o = 0; o < numPixels; o++) {
473
+ if (bitsLeft === 0) {
474
+ buffer = src[i++];
475
+ bitsLeft = 32;
476
+ }
477
+ if (bitsLeft >= bitsPerPixel) {
478
+ n = buffer >>> bitsLeft - bitsPerPixel & bitMask;
479
+ bitsLeft -= bitsPerPixel;
480
+ } else {
481
+ missingBits = bitsPerPixel - bitsLeft;
482
+ n = (buffer & bitMask) << missingBits & bitMask;
483
+ buffer = src[i++];
484
+ bitsLeft = 32 - missingBits;
485
+ n += buffer >>> bitsLeft;
486
+ }
487
+ dest[o] = n < nmax ? offset + n * scale : maxValue;
488
+ }
489
+ }
490
+ },
491
+ unstuffLUT: function(src, bitsPerPixel, numPixels, offset, scale, maxValue) {
492
+ var bitMask = (1 << bitsPerPixel) - 1;
493
+ var i = 0, o = 0, missingBits = 0, bitsLeft = 0, n = 0;
494
+ var buffer;
495
+ var dest = [];
496
+ var numInvalidTailBytes = src.length * 4 - Math.ceil(bitsPerPixel * numPixels / 8);
497
+ src[src.length - 1] <<= 8 * numInvalidTailBytes;
498
+ var nmax = Math.ceil((maxValue - offset) / scale);
499
+ for (o = 0; o < numPixels; o++) {
500
+ if (bitsLeft === 0) {
501
+ buffer = src[i++];
502
+ bitsLeft = 32;
503
+ }
504
+ if (bitsLeft >= bitsPerPixel) {
505
+ n = buffer >>> bitsLeft - bitsPerPixel & bitMask;
506
+ bitsLeft -= bitsPerPixel;
507
+ } else {
508
+ missingBits = bitsPerPixel - bitsLeft;
509
+ n = (buffer & bitMask) << missingBits & bitMask;
510
+ buffer = src[i++];
511
+ bitsLeft = 32 - missingBits;
512
+ n += buffer >>> bitsLeft;
513
+ }
514
+ dest[o] = n < nmax ? offset + n * scale : maxValue;
515
+ }
516
+ dest.unshift(offset);
517
+ return dest;
518
+ },
519
+ unstuff2: function(src, dest, bitsPerPixel, numPixels, lutArr, offset, scale, maxValue) {
520
+ var bitMask = (1 << bitsPerPixel) - 1;
521
+ var i = 0, o;
522
+ var bitsLeft = 0, bitPos = 0;
523
+ var n, buffer, missingBits;
524
+ if (lutArr) {
525
+ for (o = 0; o < numPixels; o++) {
526
+ if (bitsLeft === 0) {
527
+ buffer = src[i++];
528
+ bitsLeft = 32;
529
+ bitPos = 0;
530
+ }
531
+ if (bitsLeft >= bitsPerPixel) {
532
+ n = buffer >>> bitPos & bitMask;
533
+ bitsLeft -= bitsPerPixel;
534
+ bitPos += bitsPerPixel;
535
+ } else {
536
+ missingBits = bitsPerPixel - bitsLeft;
537
+ n = buffer >>> bitPos & bitMask;
538
+ buffer = src[i++];
539
+ bitsLeft = 32 - missingBits;
540
+ n |= (buffer & (1 << missingBits) - 1) << bitsPerPixel - missingBits;
541
+ bitPos = missingBits;
542
+ }
543
+ dest[o] = lutArr[n];
544
+ }
545
+ } else {
546
+ var nmax = Math.ceil((maxValue - offset) / scale);
547
+ for (o = 0; o < numPixels; o++) {
548
+ if (bitsLeft === 0) {
549
+ buffer = src[i++];
550
+ bitsLeft = 32;
551
+ bitPos = 0;
552
+ }
553
+ if (bitsLeft >= bitsPerPixel) {
554
+ n = buffer >>> bitPos & bitMask;
555
+ bitsLeft -= bitsPerPixel;
556
+ bitPos += bitsPerPixel;
557
+ } else {
558
+ missingBits = bitsPerPixel - bitsLeft;
559
+ n = buffer >>> bitPos & bitMask;
560
+ buffer = src[i++];
561
+ bitsLeft = 32 - missingBits;
562
+ n |= (buffer & (1 << missingBits) - 1) << bitsPerPixel - missingBits;
563
+ bitPos = missingBits;
564
+ }
565
+ dest[o] = n < nmax ? offset + n * scale : maxValue;
566
+ }
567
+ }
568
+ return dest;
569
+ },
570
+ unstuffLUT2: function(src, bitsPerPixel, numPixels, offset, scale, maxValue) {
571
+ var bitMask = (1 << bitsPerPixel) - 1;
572
+ var i = 0, o = 0, missingBits = 0, bitsLeft = 0, n = 0, bitPos = 0;
573
+ var buffer;
574
+ var dest = [];
575
+ var nmax = Math.ceil((maxValue - offset) / scale);
576
+ for (o = 0; o < numPixels; o++) {
577
+ if (bitsLeft === 0) {
578
+ buffer = src[i++];
579
+ bitsLeft = 32;
580
+ bitPos = 0;
581
+ }
582
+ if (bitsLeft >= bitsPerPixel) {
583
+ n = buffer >>> bitPos & bitMask;
584
+ bitsLeft -= bitsPerPixel;
585
+ bitPos += bitsPerPixel;
586
+ } else {
587
+ missingBits = bitsPerPixel - bitsLeft;
588
+ n = buffer >>> bitPos & bitMask;
589
+ buffer = src[i++];
590
+ bitsLeft = 32 - missingBits;
591
+ n |= (buffer & (1 << missingBits) - 1) << bitsPerPixel - missingBits;
592
+ bitPos = missingBits;
593
+ }
594
+ dest[o] = n < nmax ? offset + n * scale : maxValue;
595
+ }
596
+ dest.unshift(offset);
597
+ return dest;
598
+ },
599
+ originalUnstuff: function(src, dest, bitsPerPixel, numPixels) {
600
+ var bitMask = (1 << bitsPerPixel) - 1;
601
+ var i = 0, o;
602
+ var bitsLeft = 0;
603
+ var n, buffer, missingBits;
604
+ var numInvalidTailBytes = src.length * 4 - Math.ceil(bitsPerPixel * numPixels / 8);
605
+ src[src.length - 1] <<= 8 * numInvalidTailBytes;
606
+ for (o = 0; o < numPixels; o++) {
607
+ if (bitsLeft === 0) {
608
+ buffer = src[i++];
609
+ bitsLeft = 32;
610
+ }
611
+ if (bitsLeft >= bitsPerPixel) {
612
+ n = buffer >>> bitsLeft - bitsPerPixel & bitMask;
613
+ bitsLeft -= bitsPerPixel;
614
+ } else {
615
+ missingBits = bitsPerPixel - bitsLeft;
616
+ n = (buffer & bitMask) << missingBits & bitMask;
617
+ buffer = src[i++];
618
+ bitsLeft = 32 - missingBits;
619
+ n += buffer >>> bitsLeft;
620
+ }
621
+ dest[o] = n;
622
+ }
623
+ return dest;
624
+ },
625
+ originalUnstuff2: function(src, dest, bitsPerPixel, numPixels) {
626
+ var bitMask = (1 << bitsPerPixel) - 1;
627
+ var i = 0, o;
628
+ var bitsLeft = 0, bitPos = 0;
629
+ var n, buffer, missingBits;
630
+ for (o = 0; o < numPixels; o++) {
631
+ if (bitsLeft === 0) {
632
+ buffer = src[i++];
633
+ bitsLeft = 32;
634
+ bitPos = 0;
635
+ }
636
+ if (bitsLeft >= bitsPerPixel) {
637
+ n = buffer >>> bitPos & bitMask;
638
+ bitsLeft -= bitsPerPixel;
639
+ bitPos += bitsPerPixel;
640
+ } else {
641
+ missingBits = bitsPerPixel - bitsLeft;
642
+ n = buffer >>> bitPos & bitMask;
643
+ buffer = src[i++];
644
+ bitsLeft = 32 - missingBits;
645
+ n |= (buffer & (1 << missingBits) - 1) << bitsPerPixel - missingBits;
646
+ bitPos = missingBits;
647
+ }
648
+ dest[o] = n;
649
+ }
650
+ return dest;
651
+ }
652
+ };
653
+ var Lerc2Helpers = {
654
+ HUFFMAN_LUT_BITS_MAX: 12,
655
+ //use 2^12 lut, treat it like constant
656
+ computeChecksumFletcher32: function(input) {
657
+ var sum1 = 65535, sum2 = 65535;
658
+ var len = input.length;
659
+ var words = Math.floor(len / 2);
660
+ var i = 0;
661
+ while (words) {
662
+ var tlen = words >= 359 ? 359 : words;
663
+ words -= tlen;
664
+ do {
665
+ sum1 += input[i++] << 8;
666
+ sum2 += sum1 += input[i++];
667
+ } while (--tlen);
668
+ sum1 = (sum1 & 65535) + (sum1 >>> 16);
669
+ sum2 = (sum2 & 65535) + (sum2 >>> 16);
670
+ }
671
+ if (len & 1) {
672
+ sum2 += sum1 += input[i] << 8;
673
+ }
674
+ sum1 = (sum1 & 65535) + (sum1 >>> 16);
675
+ sum2 = (sum2 & 65535) + (sum2 >>> 16);
676
+ return (sum2 << 16 | sum1) >>> 0;
677
+ },
678
+ readHeaderInfo: function(input, data) {
679
+ var ptr = data.ptr;
680
+ var fileIdView = new Uint8Array(input, ptr, 6);
681
+ var headerInfo = {};
682
+ headerInfo.fileIdentifierString = String.fromCharCode.apply(null, fileIdView);
683
+ if (headerInfo.fileIdentifierString.lastIndexOf("Lerc2", 0) !== 0) {
684
+ throw "Unexpected file identifier string (expect Lerc2 ): " + headerInfo.fileIdentifierString;
685
+ }
686
+ ptr += 6;
687
+ var view = new DataView(input, ptr, 8);
688
+ var fileVersion = view.getInt32(0, true);
689
+ headerInfo.fileVersion = fileVersion;
690
+ ptr += 4;
691
+ if (fileVersion >= 3) {
692
+ headerInfo.checksum = view.getUint32(4, true);
693
+ ptr += 4;
694
+ }
695
+ view = new DataView(input, ptr, 12);
696
+ headerInfo.height = view.getUint32(0, true);
697
+ headerInfo.width = view.getUint32(4, true);
698
+ ptr += 8;
699
+ if (fileVersion >= 4) {
700
+ headerInfo.numDims = view.getUint32(8, true);
701
+ ptr += 4;
702
+ } else {
703
+ headerInfo.numDims = 1;
704
+ }
705
+ view = new DataView(input, ptr, 40);
706
+ headerInfo.numValidPixel = view.getUint32(0, true);
707
+ headerInfo.microBlockSize = view.getInt32(4, true);
708
+ headerInfo.blobSize = view.getInt32(8, true);
709
+ headerInfo.imageType = view.getInt32(12, true);
710
+ headerInfo.maxZError = view.getFloat64(16, true);
711
+ headerInfo.zMin = view.getFloat64(24, true);
712
+ headerInfo.zMax = view.getFloat64(32, true);
713
+ ptr += 40;
714
+ data.headerInfo = headerInfo;
715
+ data.ptr = ptr;
716
+ var checksum, keyLength;
717
+ if (fileVersion >= 3) {
718
+ keyLength = fileVersion >= 4 ? 52 : 48;
719
+ checksum = this.computeChecksumFletcher32(new Uint8Array(input, ptr - keyLength, headerInfo.blobSize - 14));
720
+ if (checksum !== headerInfo.checksum) {
721
+ throw "Checksum failed.";
722
+ }
723
+ }
724
+ return true;
725
+ },
726
+ checkMinMaxRanges: function(input, data) {
727
+ var headerInfo = data.headerInfo;
728
+ var OutPixelTypeArray = this.getDataTypeArray(headerInfo.imageType);
729
+ var rangeBytes = headerInfo.numDims * this.getDataTypeSize(headerInfo.imageType);
730
+ var minValues = this.readSubArray(input, data.ptr, OutPixelTypeArray, rangeBytes);
731
+ var maxValues = this.readSubArray(input, data.ptr + rangeBytes, OutPixelTypeArray, rangeBytes);
732
+ data.ptr += 2 * rangeBytes;
733
+ var i, equal = true;
734
+ for (i = 0; i < headerInfo.numDims; i++) {
735
+ if (minValues[i] !== maxValues[i]) {
736
+ equal = false;
737
+ break;
738
+ }
739
+ }
740
+ headerInfo.minValues = minValues;
741
+ headerInfo.maxValues = maxValues;
742
+ return equal;
743
+ },
744
+ readSubArray: function(input, ptr, OutPixelTypeArray, numBytes) {
745
+ var rawData;
746
+ if (OutPixelTypeArray === Uint8Array) {
747
+ rawData = new Uint8Array(input, ptr, numBytes);
748
+ } else {
749
+ var arrayBuf = new ArrayBuffer(numBytes);
750
+ var store8 = new Uint8Array(arrayBuf);
751
+ store8.set(new Uint8Array(input, ptr, numBytes));
752
+ rawData = new OutPixelTypeArray(arrayBuf);
753
+ }
754
+ return rawData;
755
+ },
756
+ readMask: function(input, data) {
757
+ var ptr = data.ptr;
758
+ var headerInfo = data.headerInfo;
759
+ var numPixels = headerInfo.width * headerInfo.height;
760
+ var numValidPixel = headerInfo.numValidPixel;
761
+ var view = new DataView(input, ptr, 4);
762
+ var mask = {};
763
+ mask.numBytes = view.getUint32(0, true);
764
+ ptr += 4;
765
+ if ((0 === numValidPixel || numPixels === numValidPixel) && 0 !== mask.numBytes) {
766
+ throw "invalid mask";
767
+ }
768
+ var bitset, resultMask;
769
+ if (numValidPixel === 0) {
770
+ bitset = new Uint8Array(Math.ceil(numPixels / 8));
771
+ mask.bitset = bitset;
772
+ resultMask = new Uint8Array(numPixels);
773
+ data.pixels.resultMask = resultMask;
774
+ ptr += mask.numBytes;
775
+ } else if (mask.numBytes > 0) {
776
+ bitset = new Uint8Array(Math.ceil(numPixels / 8));
777
+ view = new DataView(input, ptr, mask.numBytes);
778
+ var cnt = view.getInt16(0, true);
779
+ var ip = 2, op = 0, val = 0;
780
+ do {
781
+ if (cnt > 0) {
782
+ while (cnt--) {
783
+ bitset[op++] = view.getUint8(ip++);
784
+ }
785
+ } else {
786
+ val = view.getUint8(ip++);
787
+ cnt = -cnt;
788
+ while (cnt--) {
789
+ bitset[op++] = val;
790
+ }
791
+ }
792
+ cnt = view.getInt16(ip, true);
793
+ ip += 2;
794
+ } while (ip < mask.numBytes);
795
+ if (cnt !== -32768 || op < bitset.length) {
796
+ throw "Unexpected end of mask RLE encoding";
797
+ }
798
+ resultMask = new Uint8Array(numPixels);
799
+ var mb = 0, k = 0;
800
+ for (k = 0; k < numPixels; k++) {
801
+ if (k & 7) {
802
+ mb = bitset[k >> 3];
803
+ mb <<= k & 7;
804
+ } else {
805
+ mb = bitset[k >> 3];
806
+ }
807
+ if (mb & 128) {
808
+ resultMask[k] = 1;
809
+ }
810
+ }
811
+ data.pixels.resultMask = resultMask;
812
+ mask.bitset = bitset;
813
+ ptr += mask.numBytes;
814
+ }
815
+ data.ptr = ptr;
816
+ data.mask = mask;
817
+ return true;
818
+ },
819
+ readDataOneSweep: function(input, data, OutPixelTypeArray) {
820
+ var ptr = data.ptr;
821
+ var headerInfo = data.headerInfo;
822
+ var numDims = headerInfo.numDims;
823
+ var numPixels = headerInfo.width * headerInfo.height;
824
+ var imageType = headerInfo.imageType;
825
+ var numBytes = headerInfo.numValidPixel * Lerc2Helpers.getDataTypeSize(imageType) * numDims;
826
+ var rawData;
827
+ var mask = data.pixels.resultMask;
828
+ if (OutPixelTypeArray === Uint8Array) {
829
+ rawData = new Uint8Array(input, ptr, numBytes);
830
+ } else {
831
+ var arrayBuf = new ArrayBuffer(numBytes);
832
+ var store8 = new Uint8Array(arrayBuf);
833
+ store8.set(new Uint8Array(input, ptr, numBytes));
834
+ rawData = new OutPixelTypeArray(arrayBuf);
835
+ }
836
+ if (rawData.length === numPixels * numDims) {
837
+ data.pixels.resultPixels = rawData;
838
+ } else {
839
+ data.pixels.resultPixels = new OutPixelTypeArray(numPixels * numDims);
840
+ var z = 0, k = 0, i = 0, nStart = 0;
841
+ if (numDims > 1) {
842
+ for (i = 0; i < numDims; i++) {
843
+ nStart = i * numPixels;
844
+ for (k = 0; k < numPixels; k++) {
845
+ if (mask[k]) {
846
+ data.pixels.resultPixels[nStart + k] = rawData[z++];
847
+ }
848
+ }
849
+ }
850
+ } else {
851
+ for (k = 0; k < numPixels; k++) {
852
+ if (mask[k]) {
853
+ data.pixels.resultPixels[k] = rawData[z++];
854
+ }
855
+ }
856
+ }
857
+ }
858
+ ptr += numBytes;
859
+ data.ptr = ptr;
860
+ return true;
861
+ },
862
+ readHuffmanTree: function(input, data) {
863
+ var BITS_MAX = this.HUFFMAN_LUT_BITS_MAX;
864
+ var view = new DataView(input, data.ptr, 16);
865
+ data.ptr += 16;
866
+ var version = view.getInt32(0, true);
867
+ if (version < 2) {
868
+ throw "unsupported Huffman version";
869
+ }
870
+ var size = view.getInt32(4, true);
871
+ var i0 = view.getInt32(8, true);
872
+ var i1 = view.getInt32(12, true);
873
+ if (i0 >= i1) {
874
+ return false;
875
+ }
876
+ var blockDataBuffer = new Uint32Array(i1 - i0);
877
+ Lerc2Helpers.decodeBits(input, data, blockDataBuffer);
878
+ var codeTable = [];
879
+ var i, j, k, len;
880
+ for (i = i0; i < i1; i++) {
881
+ j = i - (i < size ? 0 : size);
882
+ codeTable[j] = { first: blockDataBuffer[i - i0], second: null };
883
+ }
884
+ var dataBytes = input.byteLength - data.ptr;
885
+ var dataWords = Math.ceil(dataBytes / 4);
886
+ var arrayBuf = new ArrayBuffer(dataWords * 4);
887
+ var store8 = new Uint8Array(arrayBuf);
888
+ store8.set(new Uint8Array(input, data.ptr, dataBytes));
889
+ var stuffedData = new Uint32Array(arrayBuf);
890
+ var bitPos = 0, word, srcPtr = 0;
891
+ word = stuffedData[0];
892
+ for (i = i0; i < i1; i++) {
893
+ j = i - (i < size ? 0 : size);
894
+ len = codeTable[j].first;
895
+ if (len > 0) {
896
+ codeTable[j].second = word << bitPos >>> 32 - len;
897
+ if (32 - bitPos >= len) {
898
+ bitPos += len;
899
+ if (bitPos === 32) {
900
+ bitPos = 0;
901
+ srcPtr++;
902
+ word = stuffedData[srcPtr];
903
+ }
904
+ } else {
905
+ bitPos += len - 32;
906
+ srcPtr++;
907
+ word = stuffedData[srcPtr];
908
+ codeTable[j].second |= word >>> 32 - bitPos;
909
+ }
910
+ }
911
+ }
912
+ var numBitsLUT = 0, numBitsLUTQick = 0;
913
+ var tree = new TreeNode();
914
+ for (i = 0; i < codeTable.length; i++) {
915
+ if (codeTable[i] !== void 0) {
916
+ numBitsLUT = Math.max(numBitsLUT, codeTable[i].first);
917
+ }
918
+ }
919
+ if (numBitsLUT >= BITS_MAX) {
920
+ numBitsLUTQick = BITS_MAX;
921
+ } else {
922
+ numBitsLUTQick = numBitsLUT;
923
+ }
924
+ if (numBitsLUT >= 30) {
925
+ console.log("WARning, large NUM LUT BITS IS " + numBitsLUT);
926
+ }
927
+ var decodeLut = [], entry, code, numEntries, jj, currentBit, node;
928
+ for (i = i0; i < i1; i++) {
929
+ j = i - (i < size ? 0 : size);
930
+ len = codeTable[j].first;
931
+ if (len > 0) {
932
+ entry = [len, j];
933
+ if (len <= numBitsLUTQick) {
934
+ code = codeTable[j].second << numBitsLUTQick - len;
935
+ numEntries = 1 << numBitsLUTQick - len;
936
+ for (k = 0; k < numEntries; k++) {
937
+ decodeLut[code | k] = entry;
938
+ }
939
+ } else {
940
+ code = codeTable[j].second;
941
+ node = tree;
942
+ for (jj = len - 1; jj >= 0; jj--) {
943
+ currentBit = code >>> jj & 1;
944
+ if (currentBit) {
945
+ if (!node.right) {
946
+ node.right = new TreeNode();
947
+ }
948
+ node = node.right;
949
+ } else {
950
+ if (!node.left) {
951
+ node.left = new TreeNode();
952
+ }
953
+ node = node.left;
954
+ }
955
+ if (jj === 0 && !node.val) {
956
+ node.val = entry[1];
957
+ }
958
+ }
959
+ }
960
+ }
961
+ }
962
+ return {
963
+ decodeLut,
964
+ numBitsLUTQick,
965
+ numBitsLUT,
966
+ tree,
967
+ stuffedData,
968
+ srcPtr,
969
+ bitPos
970
+ };
971
+ },
972
+ readHuffman: function(input, data, OutPixelTypeArray) {
973
+ var headerInfo = data.headerInfo;
974
+ var numDims = headerInfo.numDims;
975
+ var height = data.headerInfo.height;
976
+ var width = data.headerInfo.width;
977
+ var numPixels = width * height;
978
+ var huffmanInfo = this.readHuffmanTree(input, data);
979
+ var decodeLut = huffmanInfo.decodeLut;
980
+ var tree = huffmanInfo.tree;
981
+ var stuffedData = huffmanInfo.stuffedData;
982
+ var srcPtr = huffmanInfo.srcPtr;
983
+ var bitPos = huffmanInfo.bitPos;
984
+ var numBitsLUTQick = huffmanInfo.numBitsLUTQick;
985
+ var numBitsLUT = huffmanInfo.numBitsLUT;
986
+ var offset = data.headerInfo.imageType === 0 ? 128 : 0;
987
+ var node, val, delta, mask = data.pixels.resultMask, valTmp, valTmpQuick, currentBit;
988
+ var i, j, k, ii;
989
+ var prevVal = 0;
990
+ if (bitPos > 0) {
991
+ srcPtr++;
992
+ bitPos = 0;
993
+ }
994
+ var word = stuffedData[srcPtr];
995
+ var deltaEncode = data.encodeMode === 1;
996
+ var resultPixelsAllDim = new OutPixelTypeArray(numPixels * numDims);
997
+ var resultPixels = resultPixelsAllDim;
998
+ var iDim;
999
+ for (iDim = 0; iDim < headerInfo.numDims; iDim++) {
1000
+ if (numDims > 1) {
1001
+ resultPixels = new OutPixelTypeArray(resultPixelsAllDim.buffer, numPixels * iDim, numPixels);
1002
+ prevVal = 0;
1003
+ }
1004
+ if (data.headerInfo.numValidPixel === width * height) {
1005
+ for (k = 0, i = 0; i < height; i++) {
1006
+ for (j = 0; j < width; j++, k++) {
1007
+ val = 0;
1008
+ valTmp = word << bitPos >>> 32 - numBitsLUTQick;
1009
+ valTmpQuick = valTmp;
1010
+ if (32 - bitPos < numBitsLUTQick) {
1011
+ valTmp |= stuffedData[srcPtr + 1] >>> 64 - bitPos - numBitsLUTQick;
1012
+ valTmpQuick = valTmp;
1013
+ }
1014
+ if (decodeLut[valTmpQuick]) {
1015
+ val = decodeLut[valTmpQuick][1];
1016
+ bitPos += decodeLut[valTmpQuick][0];
1017
+ } else {
1018
+ valTmp = word << bitPos >>> 32 - numBitsLUT;
1019
+ valTmpQuick = valTmp;
1020
+ if (32 - bitPos < numBitsLUT) {
1021
+ valTmp |= stuffedData[srcPtr + 1] >>> 64 - bitPos - numBitsLUT;
1022
+ valTmpQuick = valTmp;
1023
+ }
1024
+ node = tree;
1025
+ for (ii = 0; ii < numBitsLUT; ii++) {
1026
+ currentBit = valTmp >>> numBitsLUT - ii - 1 & 1;
1027
+ node = currentBit ? node.right : node.left;
1028
+ if (!(node.left || node.right)) {
1029
+ val = node.val;
1030
+ bitPos = bitPos + ii + 1;
1031
+ break;
1032
+ }
1033
+ }
1034
+ }
1035
+ if (bitPos >= 32) {
1036
+ bitPos -= 32;
1037
+ srcPtr++;
1038
+ word = stuffedData[srcPtr];
1039
+ }
1040
+ delta = val - offset;
1041
+ if (deltaEncode) {
1042
+ if (j > 0) {
1043
+ delta += prevVal;
1044
+ } else if (i > 0) {
1045
+ delta += resultPixels[k - width];
1046
+ } else {
1047
+ delta += prevVal;
1048
+ }
1049
+ delta &= 255;
1050
+ resultPixels[k] = delta;
1051
+ prevVal = delta;
1052
+ } else {
1053
+ resultPixels[k] = delta;
1054
+ }
1055
+ }
1056
+ }
1057
+ } else {
1058
+ for (k = 0, i = 0; i < height; i++) {
1059
+ for (j = 0; j < width; j++, k++) {
1060
+ if (mask[k]) {
1061
+ val = 0;
1062
+ valTmp = word << bitPos >>> 32 - numBitsLUTQick;
1063
+ valTmpQuick = valTmp;
1064
+ if (32 - bitPos < numBitsLUTQick) {
1065
+ valTmp |= stuffedData[srcPtr + 1] >>> 64 - bitPos - numBitsLUTQick;
1066
+ valTmpQuick = valTmp;
1067
+ }
1068
+ if (decodeLut[valTmpQuick]) {
1069
+ val = decodeLut[valTmpQuick][1];
1070
+ bitPos += decodeLut[valTmpQuick][0];
1071
+ } else {
1072
+ valTmp = word << bitPos >>> 32 - numBitsLUT;
1073
+ valTmpQuick = valTmp;
1074
+ if (32 - bitPos < numBitsLUT) {
1075
+ valTmp |= stuffedData[srcPtr + 1] >>> 64 - bitPos - numBitsLUT;
1076
+ valTmpQuick = valTmp;
1077
+ }
1078
+ node = tree;
1079
+ for (ii = 0; ii < numBitsLUT; ii++) {
1080
+ currentBit = valTmp >>> numBitsLUT - ii - 1 & 1;
1081
+ node = currentBit ? node.right : node.left;
1082
+ if (!(node.left || node.right)) {
1083
+ val = node.val;
1084
+ bitPos = bitPos + ii + 1;
1085
+ break;
1086
+ }
1087
+ }
1088
+ }
1089
+ if (bitPos >= 32) {
1090
+ bitPos -= 32;
1091
+ srcPtr++;
1092
+ word = stuffedData[srcPtr];
1093
+ }
1094
+ delta = val - offset;
1095
+ if (deltaEncode) {
1096
+ if (j > 0 && mask[k - 1]) {
1097
+ delta += prevVal;
1098
+ } else if (i > 0 && mask[k - width]) {
1099
+ delta += resultPixels[k - width];
1100
+ } else {
1101
+ delta += prevVal;
1102
+ }
1103
+ delta &= 255;
1104
+ resultPixels[k] = delta;
1105
+ prevVal = delta;
1106
+ } else {
1107
+ resultPixels[k] = delta;
1108
+ }
1109
+ }
1110
+ }
1111
+ }
1112
+ }
1113
+ data.ptr = data.ptr + (srcPtr + 1) * 4 + (bitPos > 0 ? 4 : 0);
1114
+ }
1115
+ data.pixels.resultPixels = resultPixelsAllDim;
1116
+ },
1117
+ decodeBits: function(input, data, blockDataBuffer, offset, iDim) {
1118
+ {
1119
+ var headerInfo = data.headerInfo;
1120
+ var fileVersion = headerInfo.fileVersion;
1121
+ var blockPtr = 0;
1122
+ var view = new DataView(input, data.ptr, 5);
1123
+ var headerByte = view.getUint8(0);
1124
+ blockPtr++;
1125
+ var bits67 = headerByte >> 6;
1126
+ var n = bits67 === 0 ? 4 : 3 - bits67;
1127
+ var doLut = (headerByte & 32) > 0 ? true : false;
1128
+ var numBits = headerByte & 31;
1129
+ var numElements = 0;
1130
+ if (n === 1) {
1131
+ numElements = view.getUint8(blockPtr);
1132
+ blockPtr++;
1133
+ } else if (n === 2) {
1134
+ numElements = view.getUint16(blockPtr, true);
1135
+ blockPtr += 2;
1136
+ } else if (n === 4) {
1137
+ numElements = view.getUint32(blockPtr, true);
1138
+ blockPtr += 4;
1139
+ } else {
1140
+ throw "Invalid valid pixel count type";
1141
+ }
1142
+ var scale = 2 * headerInfo.maxZError;
1143
+ var stuffedData, arrayBuf, store8, dataBytes, dataWords;
1144
+ var lutArr, lutData, lutBytes, lutBitsPerElement, bitsPerPixel;
1145
+ var zMax = headerInfo.numDims > 1 ? headerInfo.maxValues[iDim] : headerInfo.zMax;
1146
+ if (doLut) {
1147
+ data.counter.lut++;
1148
+ lutBytes = view.getUint8(blockPtr);
1149
+ lutBitsPerElement = numBits;
1150
+ blockPtr++;
1151
+ dataBytes = Math.ceil((lutBytes - 1) * numBits / 8);
1152
+ dataWords = Math.ceil(dataBytes / 4);
1153
+ arrayBuf = new ArrayBuffer(dataWords * 4);
1154
+ store8 = new Uint8Array(arrayBuf);
1155
+ data.ptr += blockPtr;
1156
+ store8.set(new Uint8Array(input, data.ptr, dataBytes));
1157
+ lutData = new Uint32Array(arrayBuf);
1158
+ data.ptr += dataBytes;
1159
+ bitsPerPixel = 0;
1160
+ while (lutBytes - 1 >>> bitsPerPixel) {
1161
+ bitsPerPixel++;
1162
+ }
1163
+ dataBytes = Math.ceil(numElements * bitsPerPixel / 8);
1164
+ dataWords = Math.ceil(dataBytes / 4);
1165
+ arrayBuf = new ArrayBuffer(dataWords * 4);
1166
+ store8 = new Uint8Array(arrayBuf);
1167
+ store8.set(new Uint8Array(input, data.ptr, dataBytes));
1168
+ stuffedData = new Uint32Array(arrayBuf);
1169
+ data.ptr += dataBytes;
1170
+ if (fileVersion >= 3) {
1171
+ lutArr = BitStuffer.unstuffLUT2(lutData, numBits, lutBytes - 1, offset, scale, zMax);
1172
+ } else {
1173
+ lutArr = BitStuffer.unstuffLUT(lutData, numBits, lutBytes - 1, offset, scale, zMax);
1174
+ }
1175
+ if (fileVersion >= 3) {
1176
+ BitStuffer.unstuff2(stuffedData, blockDataBuffer, bitsPerPixel, numElements, lutArr);
1177
+ } else {
1178
+ BitStuffer.unstuff(stuffedData, blockDataBuffer, bitsPerPixel, numElements, lutArr);
1179
+ }
1180
+ } else {
1181
+ data.counter.bitstuffer++;
1182
+ bitsPerPixel = numBits;
1183
+ data.ptr += blockPtr;
1184
+ if (bitsPerPixel > 0) {
1185
+ dataBytes = Math.ceil(numElements * bitsPerPixel / 8);
1186
+ dataWords = Math.ceil(dataBytes / 4);
1187
+ arrayBuf = new ArrayBuffer(dataWords * 4);
1188
+ store8 = new Uint8Array(arrayBuf);
1189
+ store8.set(new Uint8Array(input, data.ptr, dataBytes));
1190
+ stuffedData = new Uint32Array(arrayBuf);
1191
+ data.ptr += dataBytes;
1192
+ if (fileVersion >= 3) {
1193
+ if (offset == null) {
1194
+ BitStuffer.originalUnstuff2(stuffedData, blockDataBuffer, bitsPerPixel, numElements);
1195
+ } else {
1196
+ BitStuffer.unstuff2(stuffedData, blockDataBuffer, bitsPerPixel, numElements, false, offset, scale, zMax);
1197
+ }
1198
+ } else {
1199
+ if (offset == null) {
1200
+ BitStuffer.originalUnstuff(stuffedData, blockDataBuffer, bitsPerPixel, numElements);
1201
+ } else {
1202
+ BitStuffer.unstuff(stuffedData, blockDataBuffer, bitsPerPixel, numElements, false, offset, scale, zMax);
1203
+ }
1204
+ }
1205
+ }
1206
+ }
1207
+ }
1208
+ },
1209
+ readTiles: function(input, data, OutPixelTypeArray) {
1210
+ var headerInfo = data.headerInfo;
1211
+ var width = headerInfo.width;
1212
+ var height = headerInfo.height;
1213
+ var microBlockSize = headerInfo.microBlockSize;
1214
+ var imageType = headerInfo.imageType;
1215
+ var dataTypeSize = Lerc2Helpers.getDataTypeSize(imageType);
1216
+ var numBlocksX = Math.ceil(width / microBlockSize);
1217
+ var numBlocksY = Math.ceil(height / microBlockSize);
1218
+ data.pixels.numBlocksY = numBlocksY;
1219
+ data.pixels.numBlocksX = numBlocksX;
1220
+ data.pixels.ptr = 0;
1221
+ var row = 0, col = 0, blockY = 0, blockX = 0, thisBlockHeight = 0, thisBlockWidth = 0, bytesLeft = 0, headerByte = 0, bits67 = 0, testCode = 0, outPtr = 0, outStride = 0, numBytes = 0, bytesleft = 0, z = 0, blockPtr = 0;
1222
+ var view, block, arrayBuf, store8, rawData;
1223
+ var blockEncoding;
1224
+ var blockDataBuffer = new OutPixelTypeArray(microBlockSize * microBlockSize);
1225
+ var lastBlockHeight = height % microBlockSize || microBlockSize;
1226
+ var lastBlockWidth = width % microBlockSize || microBlockSize;
1227
+ var offsetType, offset;
1228
+ var numDims = headerInfo.numDims, iDim;
1229
+ var mask = data.pixels.resultMask;
1230
+ var resultPixels = data.pixels.resultPixels;
1231
+ for (blockY = 0; blockY < numBlocksY; blockY++) {
1232
+ thisBlockHeight = blockY !== numBlocksY - 1 ? microBlockSize : lastBlockHeight;
1233
+ for (blockX = 0; blockX < numBlocksX; blockX++) {
1234
+ thisBlockWidth = blockX !== numBlocksX - 1 ? microBlockSize : lastBlockWidth;
1235
+ outPtr = blockY * width * microBlockSize + blockX * microBlockSize;
1236
+ outStride = width - thisBlockWidth;
1237
+ for (iDim = 0; iDim < numDims; iDim++) {
1238
+ if (numDims > 1) {
1239
+ resultPixels = new OutPixelTypeArray(data.pixels.resultPixels.buffer, width * height * iDim * dataTypeSize, width * height);
1240
+ }
1241
+ bytesLeft = input.byteLength - data.ptr;
1242
+ view = new DataView(input, data.ptr, Math.min(10, bytesLeft));
1243
+ block = {};
1244
+ blockPtr = 0;
1245
+ headerByte = view.getUint8(0);
1246
+ blockPtr++;
1247
+ bits67 = headerByte >> 6 & 255;
1248
+ testCode = headerByte >> 2 & 15;
1249
+ if (testCode !== (blockX * microBlockSize >> 3 & 15)) {
1250
+ throw "integrity issue";
1251
+ }
1252
+ blockEncoding = headerByte & 3;
1253
+ if (blockEncoding > 3) {
1254
+ data.ptr += blockPtr;
1255
+ throw "Invalid block encoding (" + blockEncoding + ")";
1256
+ } else if (blockEncoding === 2) {
1257
+ data.counter.constant++;
1258
+ data.ptr += blockPtr;
1259
+ continue;
1260
+ } else if (blockEncoding === 0) {
1261
+ data.counter.uncompressed++;
1262
+ data.ptr += blockPtr;
1263
+ numBytes = thisBlockHeight * thisBlockWidth * dataTypeSize;
1264
+ bytesleft = input.byteLength - data.ptr;
1265
+ numBytes = numBytes < bytesleft ? numBytes : bytesleft;
1266
+ arrayBuf = new ArrayBuffer(numBytes % dataTypeSize === 0 ? numBytes : numBytes + dataTypeSize - numBytes % dataTypeSize);
1267
+ store8 = new Uint8Array(arrayBuf);
1268
+ store8.set(new Uint8Array(input, data.ptr, numBytes));
1269
+ rawData = new OutPixelTypeArray(arrayBuf);
1270
+ z = 0;
1271
+ if (mask) {
1272
+ for (row = 0; row < thisBlockHeight; row++) {
1273
+ for (col = 0; col < thisBlockWidth; col++) {
1274
+ if (mask[outPtr]) {
1275
+ resultPixels[outPtr] = rawData[z++];
1276
+ }
1277
+ outPtr++;
1278
+ }
1279
+ outPtr += outStride;
1280
+ }
1281
+ } else {
1282
+ for (row = 0; row < thisBlockHeight; row++) {
1283
+ for (col = 0; col < thisBlockWidth; col++) {
1284
+ resultPixels[outPtr++] = rawData[z++];
1285
+ }
1286
+ outPtr += outStride;
1287
+ }
1288
+ }
1289
+ data.ptr += z * dataTypeSize;
1290
+ } else {
1291
+ offsetType = Lerc2Helpers.getDataTypeUsed(imageType, bits67);
1292
+ offset = Lerc2Helpers.getOnePixel(block, blockPtr, offsetType, view);
1293
+ blockPtr += Lerc2Helpers.getDataTypeSize(offsetType);
1294
+ if (blockEncoding === 3) {
1295
+ data.ptr += blockPtr;
1296
+ data.counter.constantoffset++;
1297
+ if (mask) {
1298
+ for (row = 0; row < thisBlockHeight; row++) {
1299
+ for (col = 0; col < thisBlockWidth; col++) {
1300
+ if (mask[outPtr]) {
1301
+ resultPixels[outPtr] = offset;
1302
+ }
1303
+ outPtr++;
1304
+ }
1305
+ outPtr += outStride;
1306
+ }
1307
+ } else {
1308
+ for (row = 0; row < thisBlockHeight; row++) {
1309
+ for (col = 0; col < thisBlockWidth; col++) {
1310
+ resultPixels[outPtr++] = offset;
1311
+ }
1312
+ outPtr += outStride;
1313
+ }
1314
+ }
1315
+ } else {
1316
+ data.ptr += blockPtr;
1317
+ Lerc2Helpers.decodeBits(input, data, blockDataBuffer, offset, iDim);
1318
+ blockPtr = 0;
1319
+ if (mask) {
1320
+ for (row = 0; row < thisBlockHeight; row++) {
1321
+ for (col = 0; col < thisBlockWidth; col++) {
1322
+ if (mask[outPtr]) {
1323
+ resultPixels[outPtr] = blockDataBuffer[blockPtr++];
1324
+ }
1325
+ outPtr++;
1326
+ }
1327
+ outPtr += outStride;
1328
+ }
1329
+ } else {
1330
+ for (row = 0; row < thisBlockHeight; row++) {
1331
+ for (col = 0; col < thisBlockWidth; col++) {
1332
+ resultPixels[outPtr++] = blockDataBuffer[blockPtr++];
1333
+ }
1334
+ outPtr += outStride;
1335
+ }
1336
+ }
1337
+ }
1338
+ }
1339
+ }
1340
+ }
1341
+ }
1342
+ },
1343
+ /*****************
1344
+ * private methods (helper methods)
1345
+ *****************/
1346
+ formatFileInfo: function(data) {
1347
+ return {
1348
+ "fileIdentifierString": data.headerInfo.fileIdentifierString,
1349
+ "fileVersion": data.headerInfo.fileVersion,
1350
+ "imageType": data.headerInfo.imageType,
1351
+ "height": data.headerInfo.height,
1352
+ "width": data.headerInfo.width,
1353
+ "numValidPixel": data.headerInfo.numValidPixel,
1354
+ "microBlockSize": data.headerInfo.microBlockSize,
1355
+ "blobSize": data.headerInfo.blobSize,
1356
+ "maxZError": data.headerInfo.maxZError,
1357
+ "pixelType": Lerc2Helpers.getPixelType(data.headerInfo.imageType),
1358
+ "eofOffset": data.eofOffset,
1359
+ "mask": data.mask ? {
1360
+ "numBytes": data.mask.numBytes
1361
+ } : null,
1362
+ "pixels": {
1363
+ "numBlocksX": data.pixels.numBlocksX,
1364
+ "numBlocksY": data.pixels.numBlocksY,
1365
+ //"numBytes": data.pixels.numBytes,
1366
+ "maxValue": data.headerInfo.zMax,
1367
+ "minValue": data.headerInfo.zMin,
1368
+ "noDataValue": data.noDataValue
1369
+ }
1370
+ };
1371
+ },
1372
+ constructConstantSurface: function(data) {
1373
+ var val = data.headerInfo.zMax;
1374
+ var numDims = data.headerInfo.numDims;
1375
+ var numPixels = data.headerInfo.height * data.headerInfo.width;
1376
+ var numPixelAllDims = numPixels * numDims;
1377
+ var i = 0, k = 0, nStart = 0;
1378
+ var mask = data.pixels.resultMask;
1379
+ if (mask) {
1380
+ if (numDims > 1) {
1381
+ for (i = 0; i < numDims; i++) {
1382
+ nStart = i * numPixels;
1383
+ for (k = 0; k < numPixels; k++) {
1384
+ if (mask[k]) {
1385
+ data.pixels.resultPixels[nStart + k] = val;
1386
+ }
1387
+ }
1388
+ }
1389
+ } else {
1390
+ for (k = 0; k < numPixels; k++) {
1391
+ if (mask[k]) {
1392
+ data.pixels.resultPixels[k] = val;
1393
+ }
1394
+ }
1395
+ }
1396
+ } else {
1397
+ if (data.pixels.resultPixels.fill) {
1398
+ data.pixels.resultPixels.fill(val);
1399
+ } else {
1400
+ for (k = 0; k < numPixelAllDims; k++) {
1401
+ data.pixels.resultPixels[k] = val;
1402
+ }
1403
+ }
1404
+ }
1405
+ return;
1406
+ },
1407
+ getDataTypeArray: function(t) {
1408
+ var tp;
1409
+ switch (t) {
1410
+ case 0:
1411
+ tp = Int8Array;
1412
+ break;
1413
+ case 1:
1414
+ tp = Uint8Array;
1415
+ break;
1416
+ case 2:
1417
+ tp = Int16Array;
1418
+ break;
1419
+ case 3:
1420
+ tp = Uint16Array;
1421
+ break;
1422
+ case 4:
1423
+ tp = Int32Array;
1424
+ break;
1425
+ case 5:
1426
+ tp = Uint32Array;
1427
+ break;
1428
+ case 6:
1429
+ tp = Float32Array;
1430
+ break;
1431
+ case 7:
1432
+ tp = Float64Array;
1433
+ break;
1434
+ default:
1435
+ tp = Float32Array;
1436
+ }
1437
+ return tp;
1438
+ },
1439
+ getPixelType: function(t) {
1440
+ var tp;
1441
+ switch (t) {
1442
+ case 0:
1443
+ tp = "S8";
1444
+ break;
1445
+ case 1:
1446
+ tp = "U8";
1447
+ break;
1448
+ case 2:
1449
+ tp = "S16";
1450
+ break;
1451
+ case 3:
1452
+ tp = "U16";
1453
+ break;
1454
+ case 4:
1455
+ tp = "S32";
1456
+ break;
1457
+ case 5:
1458
+ tp = "U32";
1459
+ break;
1460
+ case 6:
1461
+ tp = "F32";
1462
+ break;
1463
+ case 7:
1464
+ tp = "F64";
1465
+ break;
1466
+ default:
1467
+ tp = "F32";
1468
+ }
1469
+ return tp;
1470
+ },
1471
+ isValidPixelValue: function(t, val) {
1472
+ if (val == null) {
1473
+ return false;
1474
+ }
1475
+ var isValid;
1476
+ switch (t) {
1477
+ case 0:
1478
+ isValid = val >= -128 && val <= 127;
1479
+ break;
1480
+ case 1:
1481
+ isValid = val >= 0 && val <= 255;
1482
+ break;
1483
+ case 2:
1484
+ isValid = val >= -32768 && val <= 32767;
1485
+ break;
1486
+ case 3:
1487
+ isValid = val >= 0 && val <= 65536;
1488
+ break;
1489
+ case 4:
1490
+ isValid = val >= -2147483648 && val <= 2147483647;
1491
+ break;
1492
+ case 5:
1493
+ isValid = val >= 0 && val <= 4294967296;
1494
+ break;
1495
+ case 6:
1496
+ isValid = val >= -34027999387901484e22 && val <= 34027999387901484e22;
1497
+ break;
1498
+ case 7:
1499
+ isValid = val >= 5e-324 && val <= 17976931348623157e292;
1500
+ break;
1501
+ default:
1502
+ isValid = false;
1503
+ }
1504
+ return isValid;
1505
+ },
1506
+ getDataTypeSize: function(t) {
1507
+ var s = 0;
1508
+ switch (t) {
1509
+ case 0:
1510
+ case 1:
1511
+ s = 1;
1512
+ break;
1513
+ case 2:
1514
+ case 3:
1515
+ s = 2;
1516
+ break;
1517
+ case 4:
1518
+ case 5:
1519
+ case 6:
1520
+ s = 4;
1521
+ break;
1522
+ case 7:
1523
+ s = 8;
1524
+ break;
1525
+ default:
1526
+ s = t;
1527
+ }
1528
+ return s;
1529
+ },
1530
+ getDataTypeUsed: function(dt, tc) {
1531
+ var t = dt;
1532
+ switch (dt) {
1533
+ case 2:
1534
+ case 4:
1535
+ t = dt - tc;
1536
+ break;
1537
+ case 3:
1538
+ case 5:
1539
+ t = dt - 2 * tc;
1540
+ break;
1541
+ case 6:
1542
+ if (0 === tc) {
1543
+ t = dt;
1544
+ } else if (1 === tc) {
1545
+ t = 2;
1546
+ } else {
1547
+ t = 1;
1548
+ }
1549
+ break;
1550
+ case 7:
1551
+ if (0 === tc) {
1552
+ t = dt;
1553
+ } else {
1554
+ t = dt - 2 * tc + 1;
1555
+ }
1556
+ break;
1557
+ default:
1558
+ t = dt;
1559
+ break;
1560
+ }
1561
+ return t;
1562
+ },
1563
+ getOnePixel: function(block, blockPtr, offsetType, view) {
1564
+ var temp = 0;
1565
+ switch (offsetType) {
1566
+ case 0:
1567
+ temp = view.getInt8(blockPtr);
1568
+ break;
1569
+ case 1:
1570
+ temp = view.getUint8(blockPtr);
1571
+ break;
1572
+ case 2:
1573
+ temp = view.getInt16(blockPtr, true);
1574
+ break;
1575
+ case 3:
1576
+ temp = view.getUint16(blockPtr, true);
1577
+ break;
1578
+ case 4:
1579
+ temp = view.getInt32(blockPtr, true);
1580
+ break;
1581
+ case 5:
1582
+ temp = view.getUInt32(blockPtr, true);
1583
+ break;
1584
+ case 6:
1585
+ temp = view.getFloat32(blockPtr, true);
1586
+ break;
1587
+ case 7:
1588
+ temp = view.getFloat64(blockPtr, true);
1589
+ break;
1590
+ default:
1591
+ throw "the decoder does not understand this pixel type";
1592
+ }
1593
+ return temp;
1594
+ }
1595
+ };
1596
+ var TreeNode = function(val, left, right) {
1597
+ this.val = val;
1598
+ this.left = left;
1599
+ this.right = right;
1600
+ };
1601
+ var Lerc2Decode2 = {
1602
+ /*
1603
+ * ********removed options compared to LERC1. We can bring some of them back if needed.
1604
+ * removed pixel type. LERC2 is typed and doesn't require user to give pixel type
1605
+ * changed encodedMaskData to maskData. LERC2 's js version make it faster to use maskData directly.
1606
+ * removed returnMask. mask is used by LERC2 internally and is cost free. In case of user input mask, it's returned as well and has neglible cost.
1607
+ * removed nodatavalue. Because LERC2 pixels are typed, nodatavalue will sacrify a useful value for many types (8bit, 16bit) etc,
1608
+ * user has to be knowledgable enough about raster and their data to avoid usability issues. so nodata value is simply removed now.
1609
+ * We can add it back later if their's a clear requirement.
1610
+ * removed encodedMask. This option was not implemented in LercDecode. It can be done after decoding (less efficient)
1611
+ * removed computeUsedBitDepths.
1612
+ *
1613
+ *
1614
+ * response changes compared to LERC1
1615
+ * 1. encodedMaskData is not available
1616
+ * 2. noDataValue is optional (returns only if user's noDataValue is with in the valid data type range)
1617
+ * 3. maskData is always available
1618
+ */
1619
+ /*****************
1620
+ * public properties
1621
+ ******************/
1622
+ //HUFFMAN_LUT_BITS_MAX: 12, //use 2^12 lut, not configurable
1623
+ /*****************
1624
+ * public methods
1625
+ *****************/
1626
+ /**
1627
+ * Decode a LERC2 byte stream and return an object containing the pixel data and optional metadata.
1628
+ *
1629
+ * @param {ArrayBuffer} input The LERC input byte stream
1630
+ * @param {object} [options] options Decoding options
1631
+ * @param {number} [options.inputOffset] The number of bytes to skip in the input byte stream. A valid LERC file is expected at that position
1632
+ * @param {boolean} [options.returnFileInfo] If true, the return value will have a fileInfo property that contains metadata obtained from the LERC headers and the decoding process
1633
+ */
1634
+ decode: function(input, options) {
1635
+ options = options || {};
1636
+ var noDataValue = options.noDataValue;
1637
+ var i = 0, data = {};
1638
+ data.ptr = options.inputOffset || 0;
1639
+ data.pixels = {};
1640
+ if (!Lerc2Helpers.readHeaderInfo(input, data)) {
1641
+ return;
1642
+ }
1643
+ var headerInfo = data.headerInfo;
1644
+ var fileVersion = headerInfo.fileVersion;
1645
+ var OutPixelTypeArray = Lerc2Helpers.getDataTypeArray(headerInfo.imageType);
1646
+ Lerc2Helpers.readMask(input, data);
1647
+ if (headerInfo.numValidPixel !== headerInfo.width * headerInfo.height && !data.pixels.resultMask) {
1648
+ data.pixels.resultMask = options.maskData;
1649
+ }
1650
+ var numPixels = headerInfo.width * headerInfo.height;
1651
+ data.pixels.resultPixels = new OutPixelTypeArray(numPixels * headerInfo.numDims);
1652
+ data.counter = {
1653
+ onesweep: 0,
1654
+ uncompressed: 0,
1655
+ lut: 0,
1656
+ bitstuffer: 0,
1657
+ constant: 0,
1658
+ constantoffset: 0
1659
+ };
1660
+ if (headerInfo.numValidPixel !== 0) {
1661
+ if (headerInfo.zMax === headerInfo.zMin) {
1662
+ Lerc2Helpers.constructConstantSurface(data);
1663
+ } else if (fileVersion >= 4 && Lerc2Helpers.checkMinMaxRanges(input, data)) {
1664
+ Lerc2Helpers.constructConstantSurface(data);
1665
+ } else {
1666
+ var view = new DataView(input, data.ptr, 2);
1667
+ var bReadDataOneSweep = view.getUint8(0);
1668
+ data.ptr++;
1669
+ if (bReadDataOneSweep) {
1670
+ Lerc2Helpers.readDataOneSweep(input, data, OutPixelTypeArray);
1671
+ } else {
1672
+ if (fileVersion > 1 && headerInfo.imageType <= 1 && Math.abs(headerInfo.maxZError - 0.5) < 1e-5) {
1673
+ var flagHuffman = view.getUint8(1);
1674
+ data.ptr++;
1675
+ data.encodeMode = flagHuffman;
1676
+ if (flagHuffman > 2 || fileVersion < 4 && flagHuffman > 1) {
1677
+ throw "Invalid Huffman flag " + flagHuffman;
1678
+ }
1679
+ if (flagHuffman) {
1680
+ Lerc2Helpers.readHuffman(input, data, OutPixelTypeArray);
1681
+ } else {
1682
+ Lerc2Helpers.readTiles(input, data, OutPixelTypeArray);
1683
+ }
1684
+ } else {
1685
+ Lerc2Helpers.readTiles(input, data, OutPixelTypeArray);
1686
+ }
1687
+ }
1688
+ }
1689
+ }
1690
+ data.eofOffset = data.ptr;
1691
+ var diff;
1692
+ if (options.inputOffset) {
1693
+ diff = data.headerInfo.blobSize + options.inputOffset - data.ptr;
1694
+ if (Math.abs(diff) >= 1) {
1695
+ data.eofOffset = options.inputOffset + data.headerInfo.blobSize;
1696
+ }
1697
+ } else {
1698
+ diff = data.headerInfo.blobSize - data.ptr;
1699
+ if (Math.abs(diff) >= 1) {
1700
+ data.eofOffset = data.headerInfo.blobSize;
1701
+ }
1702
+ }
1703
+ var result = {
1704
+ width: headerInfo.width,
1705
+ height: headerInfo.height,
1706
+ pixelData: data.pixels.resultPixels,
1707
+ minValue: headerInfo.zMin,
1708
+ maxValue: headerInfo.zMax,
1709
+ validPixelCount: headerInfo.numValidPixel,
1710
+ dimCount: headerInfo.numDims,
1711
+ dimStats: {
1712
+ minValues: headerInfo.minValues,
1713
+ maxValues: headerInfo.maxValues
1714
+ },
1715
+ maskData: data.pixels.resultMask
1716
+ //noDataValue: noDataValue
1717
+ };
1718
+ if (data.pixels.resultMask && Lerc2Helpers.isValidPixelValue(headerInfo.imageType, noDataValue)) {
1719
+ var mask = data.pixels.resultMask;
1720
+ for (i = 0; i < numPixels; i++) {
1721
+ if (!mask[i]) {
1722
+ result.pixelData[i] = noDataValue;
1723
+ }
1724
+ }
1725
+ result.noDataValue = noDataValue;
1726
+ }
1727
+ data.noDataValue = noDataValue;
1728
+ if (options.returnFileInfo) {
1729
+ result.fileInfo = Lerc2Helpers.formatFileInfo(data);
1730
+ }
1731
+ return result;
1732
+ },
1733
+ getBandCount: function(input) {
1734
+ var count = 0;
1735
+ var i = 0;
1736
+ var temp = {};
1737
+ temp.ptr = 0;
1738
+ temp.pixels = {};
1739
+ while (i < input.byteLength - 58) {
1740
+ Lerc2Helpers.readHeaderInfo(input, temp);
1741
+ i += temp.headerInfo.blobSize;
1742
+ count++;
1743
+ temp.ptr = i;
1744
+ }
1745
+ return count;
1746
+ }
1747
+ };
1748
+ return Lerc2Decode2;
1749
+ }();
1750
+ var isPlatformLittleEndian = function() {
1751
+ var a = new ArrayBuffer(4);
1752
+ var b = new Uint8Array(a);
1753
+ var c = new Uint32Array(a);
1754
+ c[0] = 1;
1755
+ return b[0] === 1;
1756
+ }();
1757
+ var Lerc2 = {
1758
+ /************wrapper**********************************************/
1759
+ /**
1760
+ * A wrapper for decoding both LERC1 and LERC2 byte streams capable of handling multiband pixel blocks for various pixel types.
1761
+ *
1762
+ * @alias module:Lerc
1763
+ * @param {ArrayBuffer} input The LERC input byte stream
1764
+ * @param {object} [options] The decoding options below are optional.
1765
+ * @param {number} [options.inputOffset] The number of bytes to skip in the input byte stream. A valid Lerc file is expected at that position.
1766
+ * @param {string} [options.pixelType] (LERC1 only) Default value is F32. Valid pixel types for input are U8/S8/S16/U16/S32/U32/F32.
1767
+ * @param {number} [options.noDataValue] (LERC1 only). It is recommended to use the returned mask instead of setting this value.
1768
+ * @returns {{width, height, pixels, pixelType, mask, statistics}}
1769
+ * @property {number} width Width of decoded image.
1770
+ * @property {number} height Height of decoded image.
1771
+ * @property {array} pixels [band1, band2, …] Each band is a typed array of width*height.
1772
+ * @property {string} pixelType The type of pixels represented in the output.
1773
+ * @property {mask} mask Typed array with a size of width*height, or null if all pixels are valid.
1774
+ * @property {array} statistics [statistics_band1, statistics_band2, …] Each element is a statistics object representing min and max values
1775
+ **/
1776
+ decode: function(encodedData, options) {
1777
+ if (!isPlatformLittleEndian) {
1778
+ throw "Big endian system is not supported.";
1779
+ }
1780
+ options = options || {};
1781
+ var inputOffset = options.inputOffset || 0;
1782
+ var fileIdView = new Uint8Array(encodedData, inputOffset, 10);
1783
+ var fileIdentifierString = String.fromCharCode.apply(null, fileIdView);
1784
+ var lerc, majorVersion;
1785
+ if (fileIdentifierString.trim() === "CntZImage") {
1786
+ lerc = LercDecode;
1787
+ majorVersion = 1;
1788
+ } else if (fileIdentifierString.substring(0, 5) === "Lerc2") {
1789
+ lerc = Lerc2Decode;
1790
+ majorVersion = 2;
1791
+ } else {
1792
+ throw "Unexpected file identifier string: " + fileIdentifierString;
1793
+ }
1794
+ var iPlane = 0, eof = encodedData.byteLength - 10, encodedMaskData, bandMasks = [], bandMask, maskData;
1795
+ var decodedPixelBlock = {
1796
+ width: 0,
1797
+ height: 0,
1798
+ pixels: [],
1799
+ pixelType: options.pixelType,
1800
+ mask: null,
1801
+ statistics: []
1802
+ };
1803
+ while (inputOffset < eof) {
1804
+ var result = lerc.decode(encodedData, {
1805
+ inputOffset,
1806
+ //for both lerc1 and lerc2
1807
+ encodedMaskData,
1808
+ //lerc1 only
1809
+ maskData,
1810
+ //lerc2 only
1811
+ returnMask: iPlane === 0 ? true : false,
1812
+ //lerc1 only
1813
+ returnEncodedMask: iPlane === 0 ? true : false,
1814
+ //lerc1 only
1815
+ returnFileInfo: true,
1816
+ //for both lerc1 and lerc2
1817
+ pixelType: options.pixelType || null,
1818
+ //lerc1 only
1819
+ noDataValue: options.noDataValue || null
1820
+ //lerc1 only
1821
+ });
1822
+ inputOffset = result.fileInfo.eofOffset;
1823
+ if (iPlane === 0) {
1824
+ encodedMaskData = result.encodedMaskData;
1825
+ maskData = result.maskData;
1826
+ decodedPixelBlock.width = result.width;
1827
+ decodedPixelBlock.height = result.height;
1828
+ decodedPixelBlock.dimCount = result.dimCount || 1;
1829
+ decodedPixelBlock.pixelType = result.pixelType || result.fileInfo.pixelType;
1830
+ decodedPixelBlock.mask = result.maskData;
1831
+ }
1832
+ if (majorVersion > 1 && result.fileInfo.mask && result.fileInfo.mask.numBytes > 0) {
1833
+ bandMasks.push(result.maskData);
1834
+ }
1835
+ iPlane++;
1836
+ decodedPixelBlock.pixels.push(result.pixelData);
1837
+ decodedPixelBlock.statistics.push({
1838
+ minValue: result.minValue,
1839
+ maxValue: result.maxValue,
1840
+ noDataValue: result.noDataValue,
1841
+ dimStats: result.dimStats
1842
+ });
1843
+ }
1844
+ var i, j, numPixels;
1845
+ if (majorVersion > 1 && bandMasks.length > 1) {
1846
+ numPixels = decodedPixelBlock.width * decodedPixelBlock.height;
1847
+ decodedPixelBlock.bandMasks = bandMasks;
1848
+ maskData = new Uint8Array(numPixels);
1849
+ maskData.set(bandMasks[0]);
1850
+ for (i = 1; i < bandMasks.length; i++) {
1851
+ bandMask = bandMasks[i];
1852
+ for (j = 0; j < numPixels; j++) {
1853
+ maskData[j] = maskData[j] & bandMask[j];
1854
+ }
1855
+ }
1856
+ decodedPixelBlock.maskData = maskData;
1857
+ }
1858
+ return decodedPixelBlock;
1859
+ }
1860
+ };
1861
+ if (typeof define === "function" && define.amd) {
1862
+ define([], function() {
1863
+ return Lerc2;
1864
+ });
1865
+ } else if (typeof module !== "undefined" && module.exports) {
1866
+ module.exports = Lerc2;
1867
+ } else {
1868
+ this.Lerc = Lerc2;
1869
+ }
1870
+ })();
1871
+ }
1872
+ });
1873
+
1874
+ // packages/engine/Source/Core/HeightmapEncoding.js
1875
+ var HeightmapEncoding = {
1876
+ /**
1877
+ * No encoding
1878
+ *
1879
+ * @type {number}
1880
+ * @constant
1881
+ */
1882
+ NONE: 0,
1883
+ /**
1884
+ * LERC encoding
1885
+ *
1886
+ * @type {number}
1887
+ * @constant
1888
+ *
1889
+ * @see {@link https://github.com/Esri/lerc|The LERC specification}
1890
+ */
1891
+ LERC: 1
1892
+ };
1893
+ var HeightmapEncoding_default = Object.freeze(HeightmapEncoding);
1894
+
1895
+ // packages/engine/Source/Core/HeightmapTessellator.js
1896
+ var HeightmapTessellator = {};
1897
+ HeightmapTessellator.DEFAULT_STRUCTURE = Object.freeze({
1898
+ heightScale: 1,
1899
+ heightOffset: 0,
1900
+ elementsPerHeight: 1,
1901
+ stride: 1,
1902
+ elementMultiplier: 256,
1903
+ isBigEndian: false
1904
+ });
1905
+ var cartesian3Scratch = new Cartesian3_default();
1906
+ var matrix4Scratch = new Matrix4_default();
1907
+ var minimumScratch = new Cartesian3_default();
1908
+ var maximumScratch = new Cartesian3_default();
1909
+ HeightmapTessellator.computeVertices = function(options) {
1910
+ if (!defined_default(options) || !defined_default(options.heightmap)) {
1911
+ throw new DeveloperError_default("options.heightmap is required.");
1912
+ }
1913
+ if (!defined_default(options.width) || !defined_default(options.height)) {
1914
+ throw new DeveloperError_default("options.width and options.height are required.");
1915
+ }
1916
+ if (!defined_default(options.nativeRectangle)) {
1917
+ throw new DeveloperError_default("options.nativeRectangle is required.");
1918
+ }
1919
+ if (!defined_default(options.skirtHeight)) {
1920
+ throw new DeveloperError_default("options.skirtHeight is required.");
1921
+ }
1922
+ const cos = Math.cos;
1923
+ const sin = Math.sin;
1924
+ const sqrt = Math.sqrt;
1925
+ const atan = Math.atan;
1926
+ const exp = Math.exp;
1927
+ const piOverTwo = Math_default.PI_OVER_TWO;
1928
+ const toRadians = Math_default.toRadians;
1929
+ const heightmap = options.heightmap;
1930
+ const width = options.width;
1931
+ const height = options.height;
1932
+ const skirtHeight = options.skirtHeight;
1933
+ const hasSkirts = skirtHeight > 0;
1934
+ const isGeographic = defaultValue_default(options.isGeographic, true);
1935
+ const ellipsoid = defaultValue_default(options.ellipsoid, Ellipsoid_default.WGS84);
1936
+ const oneOverGlobeSemimajorAxis = 1 / ellipsoid.maximumRadius;
1937
+ const nativeRectangle = Rectangle_default.clone(options.nativeRectangle);
1938
+ const rectangle = Rectangle_default.clone(options.rectangle);
1939
+ let geographicWest;
1940
+ let geographicSouth;
1941
+ let geographicEast;
1942
+ let geographicNorth;
1943
+ if (!defined_default(rectangle)) {
1944
+ if (isGeographic) {
1945
+ geographicWest = toRadians(nativeRectangle.west);
1946
+ geographicSouth = toRadians(nativeRectangle.south);
1947
+ geographicEast = toRadians(nativeRectangle.east);
1948
+ geographicNorth = toRadians(nativeRectangle.north);
1949
+ } else {
1950
+ geographicWest = nativeRectangle.west * oneOverGlobeSemimajorAxis;
1951
+ geographicSouth = piOverTwo - 2 * atan(exp(-nativeRectangle.south * oneOverGlobeSemimajorAxis));
1952
+ geographicEast = nativeRectangle.east * oneOverGlobeSemimajorAxis;
1953
+ geographicNorth = piOverTwo - 2 * atan(exp(-nativeRectangle.north * oneOverGlobeSemimajorAxis));
1954
+ }
1955
+ } else {
1956
+ geographicWest = rectangle.west;
1957
+ geographicSouth = rectangle.south;
1958
+ geographicEast = rectangle.east;
1959
+ geographicNorth = rectangle.north;
1960
+ }
1961
+ let relativeToCenter = options.relativeToCenter;
1962
+ const hasRelativeToCenter = defined_default(relativeToCenter);
1963
+ relativeToCenter = hasRelativeToCenter ? relativeToCenter : Cartesian3_default.ZERO;
1964
+ const includeWebMercatorT = defaultValue_default(options.includeWebMercatorT, false);
1965
+ const exaggeration = defaultValue_default(options.exaggeration, 1);
1966
+ const exaggerationRelativeHeight = defaultValue_default(
1967
+ options.exaggerationRelativeHeight,
1968
+ 0
1969
+ );
1970
+ const hasExaggeration = exaggeration !== 1;
1971
+ const includeGeodeticSurfaceNormals = hasExaggeration;
1972
+ const structure = defaultValue_default(
1973
+ options.structure,
1974
+ HeightmapTessellator.DEFAULT_STRUCTURE
1975
+ );
1976
+ const heightScale = defaultValue_default(
1977
+ structure.heightScale,
1978
+ HeightmapTessellator.DEFAULT_STRUCTURE.heightScale
1979
+ );
1980
+ const heightOffset = defaultValue_default(
1981
+ structure.heightOffset,
1982
+ HeightmapTessellator.DEFAULT_STRUCTURE.heightOffset
1983
+ );
1984
+ const elementsPerHeight = defaultValue_default(
1985
+ structure.elementsPerHeight,
1986
+ HeightmapTessellator.DEFAULT_STRUCTURE.elementsPerHeight
1987
+ );
1988
+ const stride = defaultValue_default(
1989
+ structure.stride,
1990
+ HeightmapTessellator.DEFAULT_STRUCTURE.stride
1991
+ );
1992
+ const elementMultiplier = defaultValue_default(
1993
+ structure.elementMultiplier,
1994
+ HeightmapTessellator.DEFAULT_STRUCTURE.elementMultiplier
1995
+ );
1996
+ const isBigEndian = defaultValue_default(
1997
+ structure.isBigEndian,
1998
+ HeightmapTessellator.DEFAULT_STRUCTURE.isBigEndian
1999
+ );
2000
+ let rectangleWidth = Rectangle_default.computeWidth(nativeRectangle);
2001
+ let rectangleHeight = Rectangle_default.computeHeight(nativeRectangle);
2002
+ const granularityX = rectangleWidth / (width - 1);
2003
+ const granularityY = rectangleHeight / (height - 1);
2004
+ if (!isGeographic) {
2005
+ rectangleWidth *= oneOverGlobeSemimajorAxis;
2006
+ rectangleHeight *= oneOverGlobeSemimajorAxis;
2007
+ }
2008
+ const radiiSquared = ellipsoid.radiiSquared;
2009
+ const radiiSquaredX = radiiSquared.x;
2010
+ const radiiSquaredY = radiiSquared.y;
2011
+ const radiiSquaredZ = radiiSquared.z;
2012
+ let minimumHeight = 65536;
2013
+ let maximumHeight = -65536;
2014
+ const fromENU = Transforms_default.eastNorthUpToFixedFrame(
2015
+ relativeToCenter,
2016
+ ellipsoid
2017
+ );
2018
+ const toENU = Matrix4_default.inverseTransformation(fromENU, matrix4Scratch);
2019
+ let southMercatorY;
2020
+ let oneOverMercatorHeight;
2021
+ if (includeWebMercatorT) {
2022
+ southMercatorY = WebMercatorProjection_default.geodeticLatitudeToMercatorAngle(
2023
+ geographicSouth
2024
+ );
2025
+ oneOverMercatorHeight = 1 / (WebMercatorProjection_default.geodeticLatitudeToMercatorAngle(geographicNorth) - southMercatorY);
2026
+ }
2027
+ const minimum = minimumScratch;
2028
+ minimum.x = Number.POSITIVE_INFINITY;
2029
+ minimum.y = Number.POSITIVE_INFINITY;
2030
+ minimum.z = Number.POSITIVE_INFINITY;
2031
+ const maximum = maximumScratch;
2032
+ maximum.x = Number.NEGATIVE_INFINITY;
2033
+ maximum.y = Number.NEGATIVE_INFINITY;
2034
+ maximum.z = Number.NEGATIVE_INFINITY;
2035
+ let hMin = Number.POSITIVE_INFINITY;
2036
+ const gridVertexCount = width * height;
2037
+ const edgeVertexCount = skirtHeight > 0 ? width * 2 + height * 2 : 0;
2038
+ const vertexCount = gridVertexCount + edgeVertexCount;
2039
+ const positions = new Array(vertexCount);
2040
+ const heights = new Array(vertexCount);
2041
+ const uvs = new Array(vertexCount);
2042
+ const webMercatorTs = includeWebMercatorT ? new Array(vertexCount) : [];
2043
+ const geodeticSurfaceNormals = includeGeodeticSurfaceNormals ? new Array(vertexCount) : [];
2044
+ let startRow = 0;
2045
+ let endRow = height;
2046
+ let startCol = 0;
2047
+ let endCol = width;
2048
+ if (hasSkirts) {
2049
+ --startRow;
2050
+ ++endRow;
2051
+ --startCol;
2052
+ ++endCol;
2053
+ }
2054
+ const skirtOffsetPercentage = 1e-5;
2055
+ for (let rowIndex = startRow; rowIndex < endRow; ++rowIndex) {
2056
+ let row = rowIndex;
2057
+ if (row < 0) {
2058
+ row = 0;
2059
+ }
2060
+ if (row >= height) {
2061
+ row = height - 1;
2062
+ }
2063
+ let latitude = nativeRectangle.north - granularityY * row;
2064
+ if (!isGeographic) {
2065
+ latitude = piOverTwo - 2 * atan(exp(-latitude * oneOverGlobeSemimajorAxis));
2066
+ } else {
2067
+ latitude = toRadians(latitude);
2068
+ }
2069
+ let v = (latitude - geographicSouth) / (geographicNorth - geographicSouth);
2070
+ v = Math_default.clamp(v, 0, 1);
2071
+ const isNorthEdge = rowIndex === startRow;
2072
+ const isSouthEdge = rowIndex === endRow - 1;
2073
+ if (skirtHeight > 0) {
2074
+ if (isNorthEdge) {
2075
+ latitude += skirtOffsetPercentage * rectangleHeight;
2076
+ } else if (isSouthEdge) {
2077
+ latitude -= skirtOffsetPercentage * rectangleHeight;
2078
+ }
2079
+ }
2080
+ const cosLatitude = cos(latitude);
2081
+ const nZ = sin(latitude);
2082
+ const kZ = radiiSquaredZ * nZ;
2083
+ let webMercatorT;
2084
+ if (includeWebMercatorT) {
2085
+ webMercatorT = (WebMercatorProjection_default.geodeticLatitudeToMercatorAngle(latitude) - southMercatorY) * oneOverMercatorHeight;
2086
+ }
2087
+ for (let colIndex = startCol; colIndex < endCol; ++colIndex) {
2088
+ let col = colIndex;
2089
+ if (col < 0) {
2090
+ col = 0;
2091
+ }
2092
+ if (col >= width) {
2093
+ col = width - 1;
2094
+ }
2095
+ const terrainOffset = row * (width * stride) + col * stride;
2096
+ let heightSample;
2097
+ if (elementsPerHeight === 1) {
2098
+ heightSample = heightmap[terrainOffset];
2099
+ } else {
2100
+ heightSample = 0;
2101
+ let elementOffset;
2102
+ if (isBigEndian) {
2103
+ for (elementOffset = 0; elementOffset < elementsPerHeight; ++elementOffset) {
2104
+ heightSample = heightSample * elementMultiplier + heightmap[terrainOffset + elementOffset];
2105
+ }
2106
+ } else {
2107
+ for (elementOffset = elementsPerHeight - 1; elementOffset >= 0; --elementOffset) {
2108
+ heightSample = heightSample * elementMultiplier + heightmap[terrainOffset + elementOffset];
2109
+ }
2110
+ }
2111
+ }
2112
+ heightSample = heightSample * heightScale + heightOffset;
2113
+ maximumHeight = Math.max(maximumHeight, heightSample);
2114
+ minimumHeight = Math.min(minimumHeight, heightSample);
2115
+ let longitude = nativeRectangle.west + granularityX * col;
2116
+ if (!isGeographic) {
2117
+ longitude = longitude * oneOverGlobeSemimajorAxis;
2118
+ } else {
2119
+ longitude = toRadians(longitude);
2120
+ }
2121
+ let u = (longitude - geographicWest) / (geographicEast - geographicWest);
2122
+ u = Math_default.clamp(u, 0, 1);
2123
+ let index = row * width + col;
2124
+ if (skirtHeight > 0) {
2125
+ const isWestEdge = colIndex === startCol;
2126
+ const isEastEdge = colIndex === endCol - 1;
2127
+ const isEdge = isNorthEdge || isSouthEdge || isWestEdge || isEastEdge;
2128
+ const isCorner = (isNorthEdge || isSouthEdge) && (isWestEdge || isEastEdge);
2129
+ if (isCorner) {
2130
+ continue;
2131
+ } else if (isEdge) {
2132
+ heightSample -= skirtHeight;
2133
+ if (isWestEdge) {
2134
+ index = gridVertexCount + (height - row - 1);
2135
+ longitude -= skirtOffsetPercentage * rectangleWidth;
2136
+ } else if (isSouthEdge) {
2137
+ index = gridVertexCount + height + (width - col - 1);
2138
+ } else if (isEastEdge) {
2139
+ index = gridVertexCount + height + width + row;
2140
+ longitude += skirtOffsetPercentage * rectangleWidth;
2141
+ } else if (isNorthEdge) {
2142
+ index = gridVertexCount + height + width + height + col;
2143
+ }
2144
+ }
2145
+ }
2146
+ const nX = cosLatitude * cos(longitude);
2147
+ const nY = cosLatitude * sin(longitude);
2148
+ const kX = radiiSquaredX * nX;
2149
+ const kY = radiiSquaredY * nY;
2150
+ const gamma = sqrt(kX * nX + kY * nY + kZ * nZ);
2151
+ const oneOverGamma = 1 / gamma;
2152
+ const rSurfaceX = kX * oneOverGamma;
2153
+ const rSurfaceY = kY * oneOverGamma;
2154
+ const rSurfaceZ = kZ * oneOverGamma;
2155
+ const position = new Cartesian3_default();
2156
+ position.x = rSurfaceX + nX * heightSample;
2157
+ position.y = rSurfaceY + nY * heightSample;
2158
+ position.z = rSurfaceZ + nZ * heightSample;
2159
+ Matrix4_default.multiplyByPoint(toENU, position, cartesian3Scratch);
2160
+ Cartesian3_default.minimumByComponent(cartesian3Scratch, minimum, minimum);
2161
+ Cartesian3_default.maximumByComponent(cartesian3Scratch, maximum, maximum);
2162
+ hMin = Math.min(hMin, heightSample);
2163
+ positions[index] = position;
2164
+ uvs[index] = new Cartesian2_default(u, v);
2165
+ heights[index] = heightSample;
2166
+ if (includeWebMercatorT) {
2167
+ webMercatorTs[index] = webMercatorT;
2168
+ }
2169
+ if (includeGeodeticSurfaceNormals) {
2170
+ geodeticSurfaceNormals[index] = ellipsoid.geodeticSurfaceNormal(
2171
+ position
2172
+ );
2173
+ }
2174
+ }
2175
+ }
2176
+ const boundingSphere3D = BoundingSphere_default.fromPoints(positions);
2177
+ let orientedBoundingBox;
2178
+ if (defined_default(rectangle)) {
2179
+ orientedBoundingBox = OrientedBoundingBox_default.fromRectangle(
2180
+ rectangle,
2181
+ minimumHeight,
2182
+ maximumHeight,
2183
+ ellipsoid
2184
+ );
2185
+ }
2186
+ let occludeePointInScaledSpace;
2187
+ if (hasRelativeToCenter) {
2188
+ const occluder = new EllipsoidalOccluder_default(ellipsoid);
2189
+ occludeePointInScaledSpace = occluder.computeHorizonCullingPointPossiblyUnderEllipsoid(
2190
+ relativeToCenter,
2191
+ positions,
2192
+ minimumHeight
2193
+ );
2194
+ }
2195
+ const aaBox = new AxisAlignedBoundingBox_default(minimum, maximum, relativeToCenter);
2196
+ const encoding = new TerrainEncoding_default(
2197
+ relativeToCenter,
2198
+ aaBox,
2199
+ hMin,
2200
+ maximumHeight,
2201
+ fromENU,
2202
+ false,
2203
+ includeWebMercatorT,
2204
+ includeGeodeticSurfaceNormals,
2205
+ exaggeration,
2206
+ exaggerationRelativeHeight
2207
+ );
2208
+ const vertices = new Float32Array(vertexCount * encoding.stride);
2209
+ let bufferIndex = 0;
2210
+ for (let j = 0; j < vertexCount; ++j) {
2211
+ bufferIndex = encoding.encode(
2212
+ vertices,
2213
+ bufferIndex,
2214
+ positions[j],
2215
+ uvs[j],
2216
+ heights[j],
2217
+ void 0,
2218
+ webMercatorTs[j],
2219
+ geodeticSurfaceNormals[j]
2220
+ );
2221
+ }
2222
+ return {
2223
+ vertices,
2224
+ maximumHeight,
2225
+ minimumHeight,
2226
+ encoding,
2227
+ boundingSphere3D,
2228
+ orientedBoundingBox,
2229
+ occludeePointInScaledSpace
2230
+ };
2231
+ };
2232
+ var HeightmapTessellator_default = HeightmapTessellator;
2233
+
2234
+ // packages/engine/Source/Workers/createVerticesFromHeightmap.js
2235
+ var import_lerc = __toESM(require_LercDecode(), 1);
2236
+ function createVerticesFromHeightmap(parameters, transferableObjects) {
2237
+ if (parameters.encoding === HeightmapEncoding_default.LERC) {
2238
+ let result;
2239
+ try {
2240
+ result = import_lerc.default.decode(parameters.heightmap);
2241
+ } catch (error) {
2242
+ throw new RuntimeError_default(error);
2243
+ }
2244
+ const lercStatistics = result.statistics[0];
2245
+ if (lercStatistics.minValue === Number.MAX_VALUE) {
2246
+ throw new RuntimeError_default("Invalid tile data");
2247
+ }
2248
+ parameters.heightmap = result.pixels[0];
2249
+ parameters.width = result.width;
2250
+ parameters.height = result.height;
2251
+ }
2252
+ parameters.ellipsoid = Ellipsoid_default.clone(parameters.ellipsoid);
2253
+ parameters.rectangle = Rectangle_default.clone(parameters.rectangle);
2254
+ const statistics = HeightmapTessellator_default.computeVertices(parameters);
2255
+ const vertices = statistics.vertices;
2256
+ transferableObjects.push(vertices.buffer);
2257
+ return {
2258
+ vertices: vertices.buffer,
2259
+ numberOfAttributes: statistics.encoding.stride,
2260
+ minimumHeight: statistics.minimumHeight,
2261
+ maximumHeight: statistics.maximumHeight,
2262
+ gridWidth: parameters.width,
2263
+ gridHeight: parameters.height,
2264
+ boundingSphere3D: statistics.boundingSphere3D,
2265
+ orientedBoundingBox: statistics.orientedBoundingBox,
2266
+ occludeePointInScaledSpace: statistics.occludeePointInScaledSpace,
2267
+ encoding: statistics.encoding,
2268
+ westIndicesSouthToNorth: statistics.westIndicesSouthToNorth,
2269
+ southIndicesEastToWest: statistics.southIndicesEastToWest,
2270
+ eastIndicesNorthToSouth: statistics.eastIndicesNorthToSouth,
2271
+ northIndicesWestToEast: statistics.northIndicesWestToEast
2272
+ };
2273
+ }
2274
+ var createVerticesFromHeightmap_default = createTaskProcessorWorker_default(createVerticesFromHeightmap);
2275
+ export {
2276
+ createVerticesFromHeightmap_default as default
2277
+ };