{ "version": 3, "sources": ["index.js", "lib/utils/version.js", "lib/parsers/basis-module-loader.js", "lib/gl-extensions.js", "lib/utils/texture-formats.js", "lib/parsers/parse-ktx.js", "lib/utils/extract-mipmap-images.js", "lib/utils/ktx-format-helper.js", "lib/parsers/parse-basis.js", "basis-loader.js", "lib/parsers/parse-dds.js", "lib/parsers/parse-pvr.js", "lib/parsers/parse-compressed-texture.js", "compressed-texture-loader.js", "crunch-loader.js", "lib/parsers/parse-npy.js", "npy-loader.js", "lib/parsers/crunch-module-loader.js", "lib/encoders/encode-texture.js", "compressed-texture-writer.js", "lib/encoders/encode-ktx2-basis-texture.js", "ktx2-basis-writer.js", "lib/texture-api/load-image.js", "lib/texture-api/generate-url.js", "lib/texture-api/async-deep-map.js", "lib/texture-api/deep-load.js", "lib/texture-api/load-image-array.js", "lib/texture-api/load-image-cube.js"], "sourcesContent": ["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { VERSION } from \"./lib/utils/version.js\";\nexport { BasisLoader, BasisWorkerLoader } from \"./basis-loader.js\";\nexport { CompressedTextureLoader, CompressedTextureWorkerLoader } from \"./compressed-texture-loader.js\";\nexport { CrunchLoader } from \"./crunch-loader.js\";\nexport { NPYLoader, NPYWorkerLoader } from \"./npy-loader.js\";\n// Module constants\nexport { BASIS_EXTERNAL_LIBRARIES } from \"./lib/parsers/basis-module-loader.js\";\nexport { CRUNCH_EXTERNAL_LIBRARIES } from \"./lib/parsers/crunch-module-loader.js\";\n// Writers\nexport { CompressedTextureWriter } from \"./compressed-texture-writer.js\";\nexport { KTX2BasisWriter } from \"./ktx2-basis-writer.js\";\nexport const KTX2BasisWriterWorker = {\n name: 'Basis Universal Supercompressed GPU Texture',\n id: 'ktx2-basis-writer',\n module: 'textures',\n version: VERSION,\n extensions: ['ktx2'],\n worker: true,\n options: {\n useSRGB: false,\n qualityLevel: 10,\n encodeUASTC: false,\n mipmaps: false\n }\n};\n// Texture Loading API\nexport { loadImageTexture } from \"./lib/texture-api/load-image.js\";\nexport { loadImageTextureArray } from \"./lib/texture-api/load-image-array.js\";\nexport { loadImageTextureCube } from \"./lib/texture-api/load-image-cube.js\";\n// Utilities\nexport { GL_EXTENSIONS_CONSTANTS } from \"./lib/gl-extensions.js\";\nexport { selectSupportedBasisFormat } from \"./lib/parsers/parse-basis.js\";\nexport { getSupportedGPUTextureFormats } from \"./lib/utils/texture-formats.js\";\n// DEPRECATED\n// @deprecated\nexport { CrunchLoader as CrunchWorkerLoader } from \"./crunch-loader.js\";\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n// Version constant cannot be imported, it needs to correspond to the build version of **this** module.\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nexport const VERSION = typeof \"4.3.1\" !== 'undefined' ? \"4.3.1\" : 'latest';\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { registerJSModules, getJSModuleOrNull } from '@loaders.gl/loader-utils';\nimport { loadLibrary } from '@loaders.gl/worker-utils';\nexport const BASIS_EXTERNAL_LIBRARIES = {\n /** Basis transcoder, javascript wrapper part */\n TRANSCODER: 'basis_transcoder.js',\n /** Basis transcoder, compiled web assembly part */\n TRANSCODER_WASM: 'basis_transcoder.wasm',\n /** Basis encoder, javascript wrapper part */\n ENCODER: 'basis_encoder.js',\n /** Basis encoder, compiled web assembly part */\n ENCODER_WASM: 'basis_encoder.wasm'\n};\nlet loadBasisTranscoderPromise;\n/**\n * Loads wasm transcoder module\n * @param options\n * @returns {BasisFile} promise\n */\nexport async function loadBasisTranscoderModule(options) {\n registerJSModules(options.modules);\n const basis = getJSModuleOrNull('basis');\n if (basis) {\n return basis;\n }\n loadBasisTranscoderPromise ||= loadBasisTranscoder(options);\n return await loadBasisTranscoderPromise;\n}\n/**\n * Loads wasm transcoder module\n * @param options\n * @returns {BasisFile} promise\n */\nasync function loadBasisTranscoder(options) {\n let BASIS = null;\n let wasmBinary = null;\n [BASIS, wasmBinary] = await Promise.all([\n await loadLibrary(BASIS_EXTERNAL_LIBRARIES.TRANSCODER, 'textures', options),\n await loadLibrary(BASIS_EXTERNAL_LIBRARIES.TRANSCODER_WASM, 'textures', options)\n ]);\n // Depends on how import happened...\n // @ts-ignore TS2339: Property does not exist on type\n BASIS = BASIS || globalThis.BASIS;\n return await initializeBasisTranscoderModule(BASIS, wasmBinary);\n}\n/**\n * Initialize wasm transcoder module\n * @param BasisModule - js part of the module\n * @param wasmBinary - wasm part of the module\n * @returns {BasisFile} promise\n */\nfunction initializeBasisTranscoderModule(BasisModule, wasmBinary) {\n const options = {};\n if (wasmBinary) {\n options.wasmBinary = wasmBinary;\n }\n return new Promise((resolve) => {\n // if you try to return BasisModule the browser crashes!\n BasisModule(options).then((module) => {\n const { BasisFile, initializeBasis } = module;\n initializeBasis();\n resolve({ BasisFile });\n });\n });\n}\nlet loadBasisEncoderPromise;\n/**\n * Loads wasm encoder module\n * @param options\n * @returns {BasisFile, KTX2File} promise\n */\nexport async function loadBasisEncoderModule(options) {\n const modules = options.modules || {};\n if (modules.basisEncoder) {\n return modules.basisEncoder;\n }\n loadBasisEncoderPromise = loadBasisEncoderPromise || loadBasisEncoder(options);\n return await loadBasisEncoderPromise;\n}\n/**\n * Loads wasm encoder module\n * @param options\n * @returns {BasisFile, KTX2File} promise\n */\nasync function loadBasisEncoder(options) {\n let BASIS_ENCODER = null;\n let wasmBinary = null;\n [BASIS_ENCODER, wasmBinary] = await Promise.all([\n await loadLibrary(BASIS_EXTERNAL_LIBRARIES.ENCODER, 'textures', options),\n await loadLibrary(BASIS_EXTERNAL_LIBRARIES.ENCODER_WASM, 'textures', options)\n ]);\n // Depends on how import happened...\n // @ts-ignore TS2339: Property does not exist on type\n BASIS_ENCODER = BASIS_ENCODER || globalThis.BASIS;\n return await initializeBasisEncoderModule(BASIS_ENCODER, wasmBinary);\n}\n/**\n * Initialize wasm transcoder module\n * @param BasisEncoderModule - js part of the module\n * @param wasmBinary - wasm part of the module\n * @returns {BasisFile, KTX2File} promise\n */\nfunction initializeBasisEncoderModule(BasisEncoderModule, wasmBinary) {\n const options = {};\n if (wasmBinary) {\n options.wasmBinary = wasmBinary;\n }\n return new Promise((resolve) => {\n // if you try to return BasisModule the browser crashes!\n BasisEncoderModule(options).then((module) => {\n const { BasisFile, KTX2File, initializeBasis, BasisEncoder } = module;\n initializeBasis();\n resolve({ BasisFile, KTX2File, BasisEncoder });\n });\n });\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n/* eslint-disable camelcase */\nexport const GL_EXTENSIONS_CONSTANTS = {\n // WEBGL_compressed_texture_s3tc\n COMPRESSED_RGB_S3TC_DXT1_EXT: 0x83f0,\n COMPRESSED_RGBA_S3TC_DXT1_EXT: 0x83f1,\n COMPRESSED_RGBA_S3TC_DXT3_EXT: 0x83f2,\n COMPRESSED_RGBA_S3TC_DXT5_EXT: 0x83f3,\n // WEBGL_compressed_texture_es3\n COMPRESSED_R11_EAC: 0x9270,\n COMPRESSED_SIGNED_R11_EAC: 0x9271,\n COMPRESSED_RG11_EAC: 0x9272,\n COMPRESSED_SIGNED_RG11_EAC: 0x9273,\n COMPRESSED_RGB8_ETC2: 0x9274,\n COMPRESSED_RGBA8_ETC2_EAC: 0x9275,\n COMPRESSED_SRGB8_ETC2: 0x9276,\n COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: 0x9277,\n COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: 0x9278,\n COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: 0x9279,\n // WEBGL_compressed_texture_pvrtc\n COMPRESSED_RGB_PVRTC_4BPPV1_IMG: 0x8c00,\n COMPRESSED_RGBA_PVRTC_4BPPV1_IMG: 0x8c02,\n COMPRESSED_RGB_PVRTC_2BPPV1_IMG: 0x8c01,\n COMPRESSED_RGBA_PVRTC_2BPPV1_IMG: 0x8c03,\n // WEBGL_compressed_texture_etc1\n COMPRESSED_RGB_ETC1_WEBGL: 0x8d64,\n // WEBGL_compressed_texture_atc\n COMPRESSED_RGB_ATC_WEBGL: 0x8c92,\n COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL: 0x8c93,\n COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL: 0x87ee,\n // WEBGL_compressed_texture_astc\n COMPRESSED_RGBA_ASTC_4X4_KHR: 0x93b0,\n COMPRESSED_RGBA_ASTC_5X4_KHR: 0x93b1,\n COMPRESSED_RGBA_ASTC_5X5_KHR: 0x93b2,\n COMPRESSED_RGBA_ASTC_6X5_KHR: 0x93b3,\n COMPRESSED_RGBA_ASTC_6X6_KHR: 0x93b4,\n COMPRESSED_RGBA_ASTC_8X5_KHR: 0x93b5,\n COMPRESSED_RGBA_ASTC_8X6_KHR: 0x93b6,\n COMPRESSED_RGBA_ASTC_8X8_KHR: 0x93b7,\n COMPRESSED_RGBA_ASTC_10X5_KHR: 0x93b8,\n COMPRESSED_RGBA_ASTC_10X6_KHR: 0x93b9,\n COMPRESSED_RGBA_ASTC_10X8_KHR: 0x93ba,\n COMPRESSED_RGBA_ASTC_10X10_KHR: 0x93bb,\n COMPRESSED_RGBA_ASTC_12X10_KHR: 0x93bc,\n COMPRESSED_RGBA_ASTC_12X12_KHR: 0x93bd,\n COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR: 0x93d0,\n COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR: 0x93d1,\n COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR: 0x93d2,\n COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR: 0x93d3,\n COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR: 0x93d4,\n COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR: 0x93d5,\n COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR: 0x93d6,\n COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR: 0x93d7,\n COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR: 0x93d8,\n COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR: 0x93d9,\n COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR: 0x93da,\n COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR: 0x93db,\n COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR: 0x93dc,\n COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR: 0x93dd,\n // EXT_texture_compression_rgtc\n COMPRESSED_RED_RGTC1_EXT: 0x8dbb,\n COMPRESSED_SIGNED_RED_RGTC1_EXT: 0x8dbc,\n COMPRESSED_RED_GREEN_RGTC2_EXT: 0x8dbd,\n COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT: 0x8dbe,\n // WEBGL_compressed_texture_s3tc_srgb\n COMPRESSED_SRGB_S3TC_DXT1_EXT: 0x8c4c,\n COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: 0x8c4d,\n COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: 0x8c4e,\n COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: 0x8c4f\n};\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nconst BROWSER_PREFIXES = ['', 'WEBKIT_', 'MOZ_'];\nconst WEBGL_EXTENSIONS = {\n /* eslint-disable camelcase */\n WEBGL_compressed_texture_s3tc: 'dxt',\n WEBGL_compressed_texture_s3tc_srgb: 'dxt-srgb',\n WEBGL_compressed_texture_etc1: 'etc1',\n WEBGL_compressed_texture_etc: 'etc2',\n WEBGL_compressed_texture_pvrtc: 'pvrtc',\n WEBGL_compressed_texture_atc: 'atc',\n WEBGL_compressed_texture_astc: 'astc',\n EXT_texture_compression_rgtc: 'rgtc'\n /* eslint-enable camelcase */\n};\nlet formats = null;\n/**\n * Returns a list of formats.\n * Creates a temporary WebGLRenderingContext if none is provided.\n *\n * @param gl - Optional context.\n */\nexport function getSupportedGPUTextureFormats(gl) {\n if (!formats) {\n gl = gl || getWebGLContext() || undefined;\n formats = new Set();\n for (const prefix of BROWSER_PREFIXES) {\n for (const extension in WEBGL_EXTENSIONS) {\n if (gl && gl.getExtension(`${prefix}${extension}`)) {\n const gpuTextureFormat = WEBGL_EXTENSIONS[extension];\n formats.add(gpuTextureFormat);\n }\n }\n }\n }\n return formats;\n}\n/**\n * @returns {WebGLRenderingContext?}\n */\nfunction getWebGLContext() {\n try {\n const canvas = document.createElement('canvas');\n return canvas.getContext('webgl');\n }\n catch (error) {\n return null;\n }\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { read } from 'ktx-parse';\nimport { extractMipmapImages } from \"../utils/extract-mipmap-images.js\";\nimport { mapVkFormatToWebGL } from \"../utils/ktx-format-helper.js\";\nconst KTX2_ID = [\n // '\u00B4', 'K', 'T', 'X', '2', '0', '\u00AA', '\\r', '\\n', '\\x1A', '\\n'\n 0xab, 0x4b, 0x54, 0x58, 0x20, 0x32, 0x30, 0xbb, 0x0d, 0x0a, 0x1a, 0x0a\n];\n// eslint-disable-next-line complexity\nexport function isKTX(data) {\n // const id = new Uint8Array(data.buffer, data.byteOffset, data.byteLength);\n const id = new Uint8Array(data);\n const notKTX = id.byteLength < KTX2_ID.length ||\n id[0] !== KTX2_ID[0] || // '\u00B4'\n id[1] !== KTX2_ID[1] || // 'K'\n id[2] !== KTX2_ID[2] || // 'T'\n id[3] !== KTX2_ID[3] || // 'X'\n id[4] !== KTX2_ID[4] || // ' '\n id[5] !== KTX2_ID[5] || // '2'\n id[6] !== KTX2_ID[6] || // '0'\n id[7] !== KTX2_ID[7] || // '\u00AA'\n id[8] !== KTX2_ID[8] || // '\\r'\n id[9] !== KTX2_ID[9] || // '\\n'\n id[10] !== KTX2_ID[10] || // '\\x1A'\n id[11] !== KTX2_ID[11]; // '\\n'\n return !notKTX;\n}\nexport function parseKTX(arrayBuffer) {\n const uint8Array = new Uint8Array(arrayBuffer);\n const ktx = read(uint8Array);\n const mipMapLevels = Math.max(1, ktx.levels.length);\n const width = ktx.pixelWidth;\n const height = ktx.pixelHeight;\n const internalFormat = mapVkFormatToWebGL(ktx.vkFormat);\n return extractMipmapImages(ktx.levels, {\n mipMapLevels,\n width,\n height,\n sizeFunction: (level) => level.uncompressedByteLength,\n internalFormat\n });\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n/**\n * Extract mipmap images from compressed texture buffer\n * @param data - binary data of compressed texture or Array of level objects\n * @param options.mipMapLevels - number of mipmap level inside image\n * @param options.width - width of 0 - level\n * @param options.height - height of 0 - level\n * @param options.sizeFunction - format-related function to calculate level size in bytes\n * @param options.internalFormat - WebGL compatible format code\n * @returns Array of the texture levels\n */\nexport function extractMipmapImages(data, options) {\n const images = new Array(options.mipMapLevels);\n let levelWidth = options.width;\n let levelHeight = options.height;\n let offset = 0;\n for (let i = 0; i < options.mipMapLevels; ++i) {\n // @ts-expect-error\n const levelSize = getLevelSize(options, levelWidth, levelHeight, data, i);\n // @ts-expect-error\n const levelData = getLevelData(data, i, offset, levelSize);\n images[i] = {\n compressed: true,\n format: options.internalFormat,\n data: levelData,\n width: levelWidth,\n height: levelHeight,\n levelSize\n };\n levelWidth = Math.max(1, levelWidth >> 1);\n levelHeight = Math.max(1, levelHeight >> 1);\n offset += levelSize;\n }\n return images;\n}\nfunction getLevelData(data, index, offset, levelSize) {\n if (!Array.isArray(data)) {\n return new Uint8Array(data.buffer, data.byteOffset + offset, levelSize);\n }\n return data[index].levelData;\n}\nfunction getLevelSize(options, levelWidth, levelHeight, data, index) {\n if (!Array.isArray(data)) {\n return options.sizeFunction(levelWidth, levelHeight);\n }\n return options.sizeFunction(data[index]);\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { GL_EXTENSIONS_CONSTANTS } from \"../gl-extensions.js\";\nconst VULKAN_TO_WEBGL_FORMAT_MAP = {\n 131: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGB_S3TC_DXT1_EXT,\n 132: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB_S3TC_DXT1_EXT,\n 133: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_S3TC_DXT1_EXT,\n 134: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,\n 135: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_S3TC_DXT3_EXT,\n 136: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,\n 137: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_S3TC_DXT5_EXT,\n 138: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,\n 139: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RED_RGTC1_EXT,\n 140: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SIGNED_RED_RGTC1_EXT,\n 141: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RED_GREEN_RGTC2_EXT,\n 142: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,\n 147: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGB8_ETC2,\n 148: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ETC2,\n 149: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,\n 150: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,\n 151: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA8_ETC2_EAC,\n 152: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,\n 153: GL_EXTENSIONS_CONSTANTS.COMPRESSED_R11_EAC,\n 154: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SIGNED_R11_EAC,\n 155: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RG11_EAC,\n 156: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SIGNED_RG11_EAC,\n // @ts-ignore\n 157: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_4x4_KHR,\n // @ts-ignore\n 158: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,\n // @ts-ignore\n 159: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_5x4_KHR,\n // @ts-ignore\n 160: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR,\n // @ts-ignore\n 161: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_5x5_KHR,\n // @ts-ignore\n 162: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,\n // @ts-ignore\n 163: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_6x5_KHR,\n // @ts-ignore\n 164: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,\n // @ts-ignore\n 165: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_6x6_KHR,\n // @ts-ignore\n 166: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,\n // @ts-ignore\n 167: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_8x5_KHR,\n // @ts-ignore\n 168: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,\n // @ts-ignore\n 169: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_8x6_KHR,\n // @ts-ignore\n 170: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,\n // @ts-ignore\n 171: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_8x8_KHR,\n // @ts-ignore\n 172: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,\n // @ts-ignore\n 173: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_10x5_KHR,\n // @ts-ignore\n 174: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,\n // @ts-ignore\n 175: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_10x6_KHR,\n // @ts-ignore\n 176: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,\n // @ts-ignore\n 177: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_10x8_KHR,\n // @ts-ignore\n 178: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,\n // @ts-ignore\n 179: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_10x10_KHR,\n // @ts-ignore\n 180: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,\n // @ts-ignore\n 181: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_12x10_KHR,\n // @ts-ignore\n 182: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,\n // @ts-ignore\n 183: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_12x12_KHR,\n // @ts-ignore\n 184: GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,\n 1000054000: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,\n 1000054001: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,\n // @ts-ignore\n 1000066000: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_4x4_KHR,\n // @ts-ignore\n 1000066001: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_5x4_KHR,\n // @ts-ignore\n 1000066002: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_5x5_KHR,\n // @ts-ignore\n 1000066003: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_6x5_KHR,\n // @ts-ignore\n 1000066004: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_6x6_KHR,\n // @ts-ignore\n 1000066005: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_8x5_KHR,\n // @ts-ignore\n 1000066006: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_8x6_KHR,\n // @ts-ignore\n 1000066007: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_8x8_KHR,\n // @ts-ignore\n 1000066008: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_10x5_KHR,\n // @ts-ignore\n 1000066009: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_10x6_KHR,\n // @ts-ignore\n 1000066010: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_10x8_KHR,\n // @ts-ignore\n 1000066011: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_10x10_KHR,\n // @ts-ignore\n 1000066012: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_12x10_KHR,\n // @ts-ignore\n 1000066013: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_12x12_KHR\n};\n/**\n * Returns WebGl format based on Vulkan format\n * Vulkan to WebGl format mapping provided here http://github.khronos.org/KTX-Specification/#formatMapping\n * Vulkan name to format number mapping provided here: https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkFormat.html\n * @param vkFormat\n * @returns WebGL / OpenGL constant\n */\nexport function mapVkFormatToWebGL(vkFormat) {\n return VULKAN_TO_WEBGL_FORMAT_MAP[vkFormat];\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { loadBasisEncoderModule, loadBasisTranscoderModule } from \"./basis-module-loader.js\";\nimport { GL_EXTENSIONS_CONSTANTS } from \"../gl-extensions.js\";\nimport { getSupportedGPUTextureFormats } from \"../utils/texture-formats.js\";\nimport { isKTX } from \"./parse-ktx.js\";\nconst OutputFormat = {\n etc1: {\n basisFormat: 0,\n compressed: true,\n format: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGB_ETC1_WEBGL\n },\n etc2: { basisFormat: 1, compressed: true },\n bc1: {\n basisFormat: 2,\n compressed: true,\n format: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGB_S3TC_DXT1_EXT\n },\n bc3: {\n basisFormat: 3,\n compressed: true,\n format: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_S3TC_DXT5_EXT\n },\n bc4: { basisFormat: 4, compressed: true },\n bc5: { basisFormat: 5, compressed: true },\n 'bc7-m6-opaque-only': { basisFormat: 6, compressed: true },\n 'bc7-m5': { basisFormat: 7, compressed: true },\n 'pvrtc1-4-rgb': {\n basisFormat: 8,\n compressed: true,\n format: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGB_PVRTC_4BPPV1_IMG\n },\n 'pvrtc1-4-rgba': {\n basisFormat: 9,\n compressed: true,\n format: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG\n },\n 'astc-4x4': {\n basisFormat: 10,\n compressed: true,\n format: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_4X4_KHR\n },\n 'atc-rgb': { basisFormat: 11, compressed: true },\n 'atc-rgba-interpolated-alpha': { basisFormat: 12, compressed: true },\n rgba32: { basisFormat: 13, compressed: false },\n rgb565: { basisFormat: 14, compressed: false },\n bgr565: { basisFormat: 15, compressed: false },\n rgba4444: { basisFormat: 16, compressed: false }\n};\n/**\n * parse data with a Binomial Basis_Universal module\n * @param data\n * @param options\n * @returns compressed texture data\n */\nexport async function parseBasis(data, options) {\n if (options.basis.containerFormat === 'auto') {\n if (isKTX(data)) {\n const fileConstructors = await loadBasisEncoderModule(options);\n return parseKTX2File(fileConstructors.KTX2File, data, options);\n }\n const { BasisFile } = await loadBasisTranscoderModule(options);\n return parseBasisFile(BasisFile, data, options);\n }\n switch (options.basis.module) {\n case 'encoder':\n const fileConstructors = await loadBasisEncoderModule(options);\n switch (options.basis.containerFormat) {\n case 'ktx2':\n return parseKTX2File(fileConstructors.KTX2File, data, options);\n case 'basis':\n default:\n return parseBasisFile(fileConstructors.BasisFile, data, options);\n }\n case 'transcoder':\n default:\n const { BasisFile } = await loadBasisTranscoderModule(options);\n return parseBasisFile(BasisFile, data, options);\n }\n}\n/**\n * Parse *.basis file data\n * @param BasisFile - initialized transcoder module\n * @param data\n * @param options\n * @returns compressed texture data\n */\nfunction parseBasisFile(BasisFile, data, options) {\n const basisFile = new BasisFile(new Uint8Array(data));\n try {\n if (!basisFile.startTranscoding()) {\n throw new Error('Failed to start basis transcoding');\n }\n const imageCount = basisFile.getNumImages();\n const images = [];\n for (let imageIndex = 0; imageIndex < imageCount; imageIndex++) {\n const levelsCount = basisFile.getNumLevels(imageIndex);\n const levels = [];\n for (let levelIndex = 0; levelIndex < levelsCount; levelIndex++) {\n levels.push(transcodeImage(basisFile, imageIndex, levelIndex, options));\n }\n images.push(levels);\n }\n return images;\n }\n finally {\n basisFile.close();\n basisFile.delete();\n }\n}\n/**\n * Parse the particular level image of a basis file\n * @param basisFile\n * @param imageIndex\n * @param levelIndex\n * @param options\n * @returns compressed texture data\n */\nfunction transcodeImage(basisFile, imageIndex, levelIndex, options) {\n const width = basisFile.getImageWidth(imageIndex, levelIndex);\n const height = basisFile.getImageHeight(imageIndex, levelIndex);\n // See https://github.com/BinomialLLC/basis_universal/pull/83\n const hasAlpha = basisFile.getHasAlpha( /* imageIndex, levelIndex */);\n // Check options for output format etc\n const { compressed, format, basisFormat } = getBasisOptions(options, hasAlpha);\n const decodedSize = basisFile.getImageTranscodedSizeInBytes(imageIndex, levelIndex, basisFormat);\n const decodedData = new Uint8Array(decodedSize);\n if (!basisFile.transcodeImage(decodedData, imageIndex, levelIndex, basisFormat, 0, 0)) {\n throw new Error('failed to start Basis transcoding');\n }\n return {\n // standard loaders.gl image category payload\n width,\n height,\n data: decodedData,\n compressed,\n format,\n // Additional fields\n // Add levelSize field.\n hasAlpha\n };\n}\n/**\n * Parse *.ktx2 file data\n * @param KTX2File\n * @param data\n * @param options\n * @returns compressed texture data\n */\nfunction parseKTX2File(KTX2File, data, options) {\n const ktx2File = new KTX2File(new Uint8Array(data));\n try {\n if (!ktx2File.startTranscoding()) {\n throw new Error('failed to start KTX2 transcoding');\n }\n const levelsCount = ktx2File.getLevels();\n const levels = [];\n for (let levelIndex = 0; levelIndex < levelsCount; levelIndex++) {\n levels.push(transcodeKTX2Image(ktx2File, levelIndex, options));\n }\n return [levels];\n }\n finally {\n ktx2File.close();\n ktx2File.delete();\n }\n}\n/**\n * Parse the particular level image of a ktx2 file\n * @param ktx2File\n * @param levelIndex\n * @param options\n * @returns\n */\nfunction transcodeKTX2Image(ktx2File, levelIndex, options) {\n const { alphaFlag, height, width } = ktx2File.getImageLevelInfo(levelIndex, 0, 0);\n // Check options for output format etc\n const { compressed, format, basisFormat } = getBasisOptions(options, alphaFlag);\n const decodedSize = ktx2File.getImageTranscodedSizeInBytes(levelIndex, 0 /* layerIndex */, 0 /* faceIndex */, basisFormat);\n const decodedData = new Uint8Array(decodedSize);\n if (!ktx2File.transcodeImage(decodedData, levelIndex, 0 /* layerIndex */, 0 /* faceIndex */, basisFormat, 0, -1 /* channel0 */, -1 /* channel1 */)) {\n throw new Error('Failed to transcode KTX2 image');\n }\n return {\n // standard loaders.gl image category payload\n width,\n height,\n data: decodedData,\n compressed,\n // Additional fields\n levelSize: decodedSize,\n hasAlpha: alphaFlag,\n format\n };\n}\n/**\n * Get BasisFormat by loader format option\n * @param options\n * @param hasAlpha\n * @returns BasisFormat data\n */\nfunction getBasisOptions(options, hasAlpha) {\n let format = options && options.basis && options.basis.format;\n if (format === 'auto') {\n format = selectSupportedBasisFormat();\n }\n if (typeof format === 'object') {\n format = hasAlpha ? format.alpha : format.noAlpha;\n }\n format = format.toLowerCase();\n return OutputFormat[format];\n}\n/**\n * Select transcode format from the list of supported formats\n * @returns key for OutputFormat map\n */\nexport function selectSupportedBasisFormat() {\n const supportedFormats = getSupportedGPUTextureFormats();\n if (supportedFormats.has('astc')) {\n return 'astc-4x4';\n }\n else if (supportedFormats.has('dxt')) {\n return {\n alpha: 'bc3',\n noAlpha: 'bc1'\n };\n }\n else if (supportedFormats.has('pvrtc')) {\n return {\n alpha: 'pvrtc1-4-rgba',\n noAlpha: 'pvrtc1-4-rgb'\n };\n }\n else if (supportedFormats.has('etc1')) {\n return 'etc1';\n }\n else if (supportedFormats.has('etc2')) {\n return 'etc2';\n }\n return 'rgb565';\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { VERSION } from \"./lib/utils/version.js\";\nimport { parseBasis } from \"./lib/parsers/parse-basis.js\";\n/**\n * Worker loader for Basis super compressed textures\n */\nexport const BasisWorkerLoader = {\n dataType: null,\n batchType: null,\n name: 'Basis',\n id: 'basis',\n module: 'textures',\n version: VERSION,\n worker: true,\n extensions: ['basis', 'ktx2'],\n mimeTypes: ['application/octet-stream', 'image/ktx2'],\n tests: ['sB'],\n binary: true,\n options: {\n basis: {\n format: 'auto',\n libraryPath: 'libs/',\n containerFormat: 'auto',\n module: 'transcoder'\n }\n }\n};\n/**\n * Loader for Basis super compressed textures\n */\nexport const BasisLoader = {\n ...BasisWorkerLoader,\n parse: parseBasis\n};\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { assert } from '@loaders.gl/loader-utils';\nimport { GL_EXTENSIONS_CONSTANTS } from \"../gl-extensions.js\";\nimport { extractMipmapImages } from \"../utils/extract-mipmap-images.js\";\nconst DDS_CONSTANTS = {\n MAGIC_NUMBER: 0x20534444,\n HEADER_LENGTH: 31,\n MAGIC_NUMBER_INDEX: 0,\n HEADER_SIZE_INDEX: 1,\n HEADER_FLAGS_INDEX: 2,\n HEADER_HEIGHT_INDEX: 3,\n HEADER_WIDTH_INDEX: 4,\n MIPMAPCOUNT_INDEX: 7,\n HEADER_PF_FLAGS_INDEX: 20,\n HEADER_PF_FOURCC_INDEX: 21,\n DDSD_MIPMAPCOUNT: 0x20000,\n DDPF_FOURCC: 0x4\n};\nconst DDS_PIXEL_FORMATS = {\n DXT1: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGB_S3TC_DXT1_EXT,\n DXT3: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_S3TC_DXT3_EXT,\n DXT5: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_S3TC_DXT5_EXT,\n 'ATC ': GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGB_ATC_WEBGL,\n ATCA: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,\n ATCI: GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL\n};\nconst getATCLevelSize = getDxt1LevelSize;\nconst getATCALevelSize = getDxtXLevelSize;\nconst getATCILevelSize = getDxtXLevelSize;\nconst DDS_SIZE_FUNCTIONS = {\n DXT1: getDxt1LevelSize,\n DXT3: getDxtXLevelSize,\n DXT5: getDxtXLevelSize,\n 'ATC ': getATCLevelSize,\n ATCA: getATCALevelSize,\n ATCI: getATCILevelSize\n};\n/**\n * Check if data is in \"DDS\" format by its magic number\n * @param data - binary data of compressed texture\n * @returns true - data in \"DDS\" format, else - false\n */\nexport function isDDS(data) {\n const header = new Uint32Array(data, 0, DDS_CONSTANTS.HEADER_LENGTH);\n const magic = header[DDS_CONSTANTS.MAGIC_NUMBER_INDEX];\n return magic === DDS_CONSTANTS.MAGIC_NUMBER;\n}\n/**\n * Parse texture data as \"DDS\" format\n * @param data - binary data of compressed texture\n * @returns Array of the texture levels\n */\nexport function parseDDS(data) {\n const header = new Int32Array(data, 0, DDS_CONSTANTS.HEADER_LENGTH);\n const pixelFormatNumber = header[DDS_CONSTANTS.HEADER_PF_FOURCC_INDEX];\n assert(Boolean(header[DDS_CONSTANTS.HEADER_PF_FLAGS_INDEX] & DDS_CONSTANTS.DDPF_FOURCC), 'DDS: Unsupported format, must contain a FourCC code');\n const fourCC = int32ToFourCC(pixelFormatNumber);\n const internalFormat = DDS_PIXEL_FORMATS[fourCC];\n const sizeFunction = DDS_SIZE_FUNCTIONS[fourCC];\n assert(internalFormat && sizeFunction, `DDS: Unknown pixel format ${pixelFormatNumber}`);\n let mipMapLevels = 1;\n if (header[DDS_CONSTANTS.HEADER_FLAGS_INDEX] & DDS_CONSTANTS.DDSD_MIPMAPCOUNT) {\n mipMapLevels = Math.max(1, header[DDS_CONSTANTS.MIPMAPCOUNT_INDEX]);\n }\n const width = header[DDS_CONSTANTS.HEADER_WIDTH_INDEX];\n const height = header[DDS_CONSTANTS.HEADER_HEIGHT_INDEX];\n const dataOffset = header[DDS_CONSTANTS.HEADER_SIZE_INDEX] + 4;\n const image = new Uint8Array(data, dataOffset);\n return extractMipmapImages(image, {\n mipMapLevels,\n width,\n height,\n sizeFunction,\n internalFormat\n });\n}\n/**\n * DXT1 applicable function to calculate level size\n * @param width - level width\n * @param height - level height\n * @returns level size in bytes\n */\nexport function getDxt1LevelSize(width, height) {\n return ((width + 3) >> 2) * ((height + 3) >> 2) * 8;\n}\n/**\n * DXT3 & DXT5 applicable function to calculate level size\n * @param width - level width\n * @param height - level height\n * @returns level size in bytes\n */\nexport function getDxtXLevelSize(width, height) {\n return ((width + 3) >> 2) * ((height + 3) >> 2) * 16;\n}\n/**\n * Convert every byte of Int32 value to char\n * @param value - Int32 number\n * @returns string of 4 characters\n */\nfunction int32ToFourCC(value) {\n return String.fromCharCode(value & 0xff, (value >> 8) & 0xff, (value >> 16) & 0xff, (value >> 24) & 0xff);\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { GL_EXTENSIONS_CONSTANTS } from \"../gl-extensions.js\";\nimport { extractMipmapImages } from \"../utils/extract-mipmap-images.js\";\nconst PVR_CONSTANTS = {\n MAGIC_NUMBER: 0x03525650,\n MAGIC_NUMBER_EXTRA: 0x50565203,\n HEADER_LENGTH: 13,\n HEADER_SIZE: 52,\n MAGIC_NUMBER_INDEX: 0,\n PIXEL_FORMAT_INDEX: 2,\n COLOUR_SPACE_INDEX: 4,\n HEIGHT_INDEX: 6,\n WIDTH_INDEX: 7,\n MIPMAPCOUNT_INDEX: 11,\n METADATA_SIZE_INDEX: 12\n};\nconst PVR_PIXEL_FORMATS = {\n 0: [GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGB_PVRTC_2BPPV1_IMG],\n 1: [GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG],\n 2: [GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGB_PVRTC_4BPPV1_IMG],\n 3: [GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG],\n 6: [GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGB_ETC1_WEBGL],\n 7: [GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGB_S3TC_DXT1_EXT],\n 9: [GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_S3TC_DXT3_EXT],\n 11: [GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_S3TC_DXT5_EXT],\n 22: [GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGB8_ETC2],\n 23: [GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA8_ETC2_EAC],\n 24: [GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2],\n 25: [GL_EXTENSIONS_CONSTANTS.COMPRESSED_R11_EAC],\n 26: [GL_EXTENSIONS_CONSTANTS.COMPRESSED_RG11_EAC],\n 27: [\n GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_4X4_KHR,\n GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR\n ],\n 28: [\n GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_5X4_KHR,\n GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR\n ],\n 29: [\n GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_5X5_KHR,\n GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR\n ],\n 30: [\n GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_6X5_KHR,\n GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR\n ],\n 31: [\n GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_6X6_KHR,\n GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR\n ],\n 32: [\n GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_8X5_KHR,\n GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR\n ],\n 33: [\n GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_8X6_KHR,\n GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR\n ],\n 34: [\n GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_8X8_KHR,\n GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR\n ],\n 35: [\n GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_10X5_KHR,\n GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR\n ],\n 36: [\n GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_10X6_KHR,\n GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR\n ],\n 37: [\n GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_10X8_KHR,\n GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR\n ],\n 38: [\n GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_10X10_KHR,\n GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR\n ],\n 39: [\n GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_12X10_KHR,\n GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR\n ],\n 40: [\n GL_EXTENSIONS_CONSTANTS.COMPRESSED_RGBA_ASTC_12X12_KHR,\n GL_EXTENSIONS_CONSTANTS.COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR\n ]\n};\nconst PVR_SIZE_FUNCTIONS = {\n 0: pvrtc2bppSize,\n 1: pvrtc2bppSize,\n 2: pvrtc4bppSize,\n 3: pvrtc4bppSize,\n 6: dxtEtcSmallSize,\n 7: dxtEtcSmallSize,\n 9: dxtEtcAstcBigSize,\n 11: dxtEtcAstcBigSize,\n 22: dxtEtcSmallSize,\n 23: dxtEtcAstcBigSize,\n 24: dxtEtcSmallSize,\n 25: dxtEtcSmallSize,\n 26: dxtEtcAstcBigSize,\n 27: dxtEtcAstcBigSize,\n 28: atc5x4Size,\n 29: atc5x5Size,\n 30: atc6x5Size,\n 31: atc6x6Size,\n 32: atc8x5Size,\n 33: atc8x6Size,\n 34: atc8x8Size,\n 35: atc10x5Size,\n 36: atc10x6Size,\n 37: atc10x8Size,\n 38: atc10x10Size,\n 39: atc12x10Size,\n 40: atc12x12Size\n};\n/**\n * Check if data is in \"PVR\" format by its magic number\n * @param data - binary data of compressed texture\n * @returns true - data in \"PVR\" format, else - false\n */\nexport function isPVR(data) {\n const header = new Uint32Array(data, 0, PVR_CONSTANTS.HEADER_LENGTH);\n const version = header[PVR_CONSTANTS.MAGIC_NUMBER_INDEX];\n return version === PVR_CONSTANTS.MAGIC_NUMBER || version === PVR_CONSTANTS.MAGIC_NUMBER_EXTRA;\n}\n/**\n * Parse texture data as \"PVR\" format\n * @param data - binary data of compressed texture\n * @returns Array of the texture levels\n * @see http://cdn.imgtec.com/sdk-documentation/PVR+File+Format.Specification.pdf\n */\nexport function parsePVR(data) {\n const header = new Uint32Array(data, 0, PVR_CONSTANTS.HEADER_LENGTH);\n const pvrFormat = header[PVR_CONSTANTS.PIXEL_FORMAT_INDEX];\n const colourSpace = header[PVR_CONSTANTS.COLOUR_SPACE_INDEX];\n const pixelFormats = PVR_PIXEL_FORMATS[pvrFormat] || [];\n const internalFormat = pixelFormats.length > 1 && colourSpace ? pixelFormats[1] : pixelFormats[0];\n const sizeFunction = PVR_SIZE_FUNCTIONS[pvrFormat];\n const mipMapLevels = header[PVR_CONSTANTS.MIPMAPCOUNT_INDEX];\n const width = header[PVR_CONSTANTS.WIDTH_INDEX];\n const height = header[PVR_CONSTANTS.HEIGHT_INDEX];\n const dataOffset = PVR_CONSTANTS.HEADER_SIZE + header[PVR_CONSTANTS.METADATA_SIZE_INDEX];\n const image = new Uint8Array(data, dataOffset);\n return extractMipmapImages(image, {\n mipMapLevels,\n width,\n height,\n sizeFunction,\n internalFormat\n });\n}\n// https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_pvrtc/\nfunction pvrtc2bppSize(width, height) {\n width = Math.max(width, 16);\n height = Math.max(height, 8);\n return (width * height) / 4;\n}\n// https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_pvrtc/\nfunction pvrtc4bppSize(width, height) {\n width = Math.max(width, 8);\n height = Math.max(height, 8);\n return (width * height) / 2;\n}\n// https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_s3tc/\n// https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_etc/\n// Size for:\n// COMPRESSED_RGB_S3TC_DXT1_EXT\n// COMPRESSED_R11_EAC\n// COMPRESSED_SIGNED_R11_EAC\n// COMPRESSED_RGB8_ETC2\n// COMPRESSED_SRGB8_ETC2\n// COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2\n// COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2\nfunction dxtEtcSmallSize(width, height) {\n return Math.floor((width + 3) / 4) * Math.floor((height + 3) / 4) * 8;\n}\n// https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_s3tc/\n// https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_etc/\n// https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_astc/\n// Size for:\n// COMPRESSED_RGBA_S3TC_DXT3_EXT\n// COMPRESSED_RGBA_S3TC_DXT5_EXT\n// COMPRESSED_RG11_EAC\n// COMPRESSED_SIGNED_RG11_EAC\n// COMPRESSED_RGBA8_ETC2_EAC\n// COMPRESSED_SRGB8_ALPHA8_ETC2_EAC\n// COMPRESSED_RGBA_ASTC_4x4_KHR\nfunction dxtEtcAstcBigSize(width, height) {\n return Math.floor((width + 3) / 4) * Math.floor((height + 3) / 4) * 16;\n}\n// https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_astc/\nfunction atc5x4Size(width, height) {\n return Math.floor((width + 4) / 5) * Math.floor((height + 3) / 4) * 16;\n}\n// https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_astc/\nfunction atc5x5Size(width, height) {\n return Math.floor((width + 4) / 5) * Math.floor((height + 4) / 5) * 16;\n}\n// https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_astc/\nfunction atc6x5Size(width, height) {\n return Math.floor((width + 5) / 6) * Math.floor((height + 4) / 5) * 16;\n}\n// https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_astc/\nfunction atc6x6Size(width, height) {\n return Math.floor((width + 5) / 6) * Math.floor((height + 5) / 6) * 16;\n}\n// https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_astc/\nfunction atc8x5Size(width, height) {\n return Math.floor((width + 7) / 8) * Math.floor((height + 4) / 5) * 16;\n}\n// https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_astc/\nfunction atc8x6Size(width, height) {\n return Math.floor((width + 7) / 8) * Math.floor((height + 5) / 6) * 16;\n}\n// https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_astc/\nfunction atc8x8Size(width, height) {\n return Math.floor((width + 7) / 8) * Math.floor((height + 7) / 8) * 16;\n}\n// https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_astc/\nfunction atc10x5Size(width, height) {\n return Math.floor((width + 9) / 10) * Math.floor((height + 4) / 5) * 16;\n}\n// https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_astc/\nfunction atc10x6Size(width, height) {\n return Math.floor((width + 9) / 10) * Math.floor((height + 5) / 6) * 16;\n}\n// https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_astc/\nfunction atc10x8Size(width, height) {\n return Math.floor((width + 9) / 10) * Math.floor((height + 7) / 8) * 16;\n}\n// https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_astc/\nfunction atc10x10Size(width, height) {\n return Math.floor((width + 9) / 10) * Math.floor((height + 9) / 10) * 16;\n}\n// https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_astc/\nfunction atc12x10Size(width, height) {\n return Math.floor((width + 11) / 12) * Math.floor((height + 9) / 10) * 16;\n}\n// https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_astc/\nfunction atc12x12Size(width, height) {\n return Math.floor((width + 11) / 12) * Math.floor((height + 11) / 12) * 16;\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { isKTX, parseKTX } from \"./parse-ktx.js\";\nimport { isDDS, parseDDS } from \"./parse-dds.js\";\nimport { isPVR, parsePVR } from \"./parse-pvr.js\";\n/**\n * Deduces format and parses compressed texture loaded in ArrayBuffer\n * @param data - binary data of compressed texture\n * @returns Array of the texture levels\n */\nexport function parseCompressedTexture(data) {\n if (isKTX(data)) {\n // TODO: remove @ts-ignore when `parseKTX` output is normalized to loaders.gl texture format\n // @ts-ignore\n return parseKTX(data);\n }\n if (isDDS(data)) {\n return parseDDS(data);\n }\n if (isPVR(data)) {\n return parsePVR(data);\n }\n throw new Error('Texture container format not recognized');\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { VERSION } from \"./lib/utils/version.js\";\nimport { parseCompressedTexture } from \"./lib/parsers/parse-compressed-texture.js\";\nimport { parseBasis } from \"./lib/parsers/parse-basis.js\";\n/**\n * Worker Loader for KTX, DDS, and PVR texture container formats\n */\nexport const CompressedTextureWorkerLoader = {\n dataType: null,\n batchType: null,\n name: 'Texture Containers',\n id: 'compressed-texture',\n module: 'textures',\n version: VERSION,\n worker: true,\n extensions: [\n 'ktx',\n 'ktx2',\n 'dds', // WEBGL_compressed_texture_s3tc, WEBGL_compressed_texture_atc\n 'pvr' // WEBGL_compressed_texture_pvrtc\n ],\n mimeTypes: [\n 'image/ktx2',\n 'image/ktx',\n 'image/vnd-ms.dds',\n 'image/x-dds',\n 'application/octet-stream'\n ],\n binary: true,\n options: {\n 'compressed-texture': {\n libraryPath: 'libs/',\n useBasis: false\n }\n }\n};\n/**\n * Loader for KTX, DDS, and PVR texture container formats\n */\nexport const CompressedTextureLoader = {\n ...CompressedTextureWorkerLoader,\n parse: async (arrayBuffer, options) => {\n if (options?.['compressed-texture']?.useBasis) {\n // @ts-expect-error TODO not allowed to modify inputs\n options.basis = {\n format: {\n alpha: 'BC3',\n noAlpha: 'BC1'\n },\n // @ts-expect-error TODO not allowed to modify inputs\n ...options.basis,\n containerFormat: 'ktx2',\n module: 'encoder'\n };\n const result = await parseBasis(arrayBuffer, options);\n return result[0];\n }\n return parseCompressedTexture(arrayBuffer);\n }\n};\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { VERSION } from \"./lib/utils/version.js\";\n/**\n * Worker loader for the Crunch compressed texture container format\n * @note We avoid bundling crunch - it is a rare format and large lib, so we only offer worker loader\n */\nexport const CrunchLoader = {\n dataType: null,\n batchType: null,\n id: 'crunch',\n name: 'Crunch',\n module: 'textures',\n version: VERSION,\n worker: true,\n extensions: ['crn'],\n mimeTypes: ['image/crn', 'image/x-crn', 'application/octet-stream'],\n binary: true,\n options: {\n crunch: {\n libraryPath: 'libs/'\n }\n }\n};\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nconst a = new Uint32Array([0x12345678]);\nconst b = new Uint8Array(a.buffer, a.byteOffset, a.byteLength);\nconst isLittleEndian = !(b[0] === 0x12);\nconst LITTLE_ENDIAN_OS = isLittleEndian;\n/**\n * The basic string format consists of 3 characters:\n * 1. a character describing the byteorder of the data (<: little-endian, >: big-endian, |: not-relevant)\n * 2. a character code giving the basic type of the array\n * 3. an integer providing the number of bytes the type uses.\n * https://numpy.org/doc/stable/reference/arrays.interface.html\n *\n * Here I only include the second and third characters, and check endianness separately\n */\nconst DTYPES = {\n u1: Uint8Array,\n i1: Int8Array,\n u2: Uint16Array,\n i2: Int16Array,\n u4: Uint32Array,\n i4: Int32Array,\n f4: Float32Array,\n f8: Float64Array\n};\nexport function parseNPY(arrayBuffer, options) {\n const view = new DataView(arrayBuffer);\n const { header, headerEndOffset } = parseHeader(view);\n const numpyType = header.descr;\n const ArrayType = DTYPES[numpyType.slice(1, 3)];\n if (!ArrayType) {\n throw new Error(`Unimplemented type ${numpyType}`);\n }\n const nArrayElements = header.shape?.reduce((a, b) => a * b);\n const arrayByteLength = nArrayElements * ArrayType.BYTES_PER_ELEMENT;\n if (arrayBuffer.byteLength < headerEndOffset + arrayByteLength) {\n throw new Error('Buffer overflow');\n }\n const data = new ArrayType(arrayBuffer.slice(headerEndOffset, headerEndOffset + arrayByteLength));\n // Swap endianness if needed\n if ((numpyType[0] === '>' && LITTLE_ENDIAN_OS) || (numpyType[0] === '<' && !LITTLE_ENDIAN_OS)) {\n throw new Error('Incorrect endianness');\n }\n return {\n data,\n header\n };\n}\n/**\n * Parse NPY header\n *\n * @param view\n * @return\n */\nfunction parseHeader(view) {\n const majorVersion = view.getUint8(6);\n // const minorVersion = view.getUint8(7);\n let offset = 8;\n let headerLength;\n if (majorVersion >= 2) {\n headerLength = view.getUint32(offset, true);\n offset += 4;\n }\n else {\n headerLength = view.getUint16(offset, true);\n offset += 2;\n }\n const encoding = majorVersion <= 2 ? 'latin1' : 'utf-8';\n const decoder = new TextDecoder(encoding);\n const headerArray = new Uint8Array(view.buffer, offset, headerLength);\n const headerText = decoder.decode(headerArray);\n offset += headerLength;\n const header = JSON.parse(headerText\n .replace(/'/g, '\"')\n .replace('False', 'false')\n .replace('(', '[')\n .replace(/,*\\),*/g, ']'));\n return { header, headerEndOffset: offset };\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { VERSION } from \"./lib/utils/version.js\";\nimport { parseNPY } from \"./lib/parsers/parse-npy.js\";\n// \\x93NUMPY\nconst NPY_MAGIC_NUMBER = new Uint8Array([147, 78, 85, 77, 80, 89]);\n/**\n * Worker loader for numpy \"tiles\"\n */\nexport const NPYWorkerLoader = {\n dataType: null,\n batchType: null,\n name: 'NPY',\n id: 'npy',\n module: 'textures',\n version: VERSION,\n worker: true,\n extensions: ['npy'],\n mimeTypes: [],\n tests: [NPY_MAGIC_NUMBER.buffer],\n options: {\n npy: {}\n }\n};\n/**\n * Loader for numpy \"tiles\"\n */\nexport const NPYLoader = {\n ...NPYWorkerLoader,\n parseSync: parseNPY,\n parse: async (arrayBuffer, options) => parseNPY(arrayBuffer, options)\n};\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n// @ts-nocheck\nimport { getJSModuleOrNull, registerJSModules } from '@loaders.gl/loader-utils';\nimport { loadLibrary } from '@loaders.gl/worker-utils';\nexport const CRUNCH_EXTERNAL_LIBRARIES = {\n /** Crunch decoder library. It is used as dynamically imported script */\n DECODER: 'crunch.js'\n};\n/**\n * Load crunch decoder module\n * @param options - loader options\n * @returns Promise of module object\n */\nexport async function loadCrunchModule(options) {\n registerJSModules(options.modules);\n const crunch = getJSModuleOrNull('crunch');\n if (crunch) {\n return crunch;\n }\n return loadCrunch(options);\n}\nlet crunchModule;\n/**\n * Load crunch decoder module\n * @param {any} options - Loader options\n * @returns {Promise} Promise of Module object\n */\nasync function loadCrunch(options) {\n if (crunchModule) {\n return crunchModule;\n }\n let loadCrunchDecoder = await loadLibrary(CRUNCH_EXTERNAL_LIBRARIES.DECODER, 'textures', options);\n // Depends on how import happened...\n // @ts-ignore TS2339: Property does not exist on type\n loadCrunchDecoder ||= globalThis.LoadCrunchDecoder;\n crunchModule = loadCrunchDecoder();\n return crunchModule;\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { ChildProcessProxy } from '@loaders.gl/worker-utils';\n/*\n * @see https://github.com/TimvanScherpenzeel/texture-compressor\n */\nexport async function encodeImageURLToCompressedTextureURL(inputUrl, outputUrl, options) {\n // prettier-ignore\n const args = [\n // Note: our actual executable is `npx`, so `texture-compressor` is an argument\n 'texture-compressor',\n '--type', 's3tc',\n '--compression', 'DXT1',\n '--quality', 'normal',\n '--input', inputUrl,\n '--output', outputUrl\n ];\n const childProcess = new ChildProcessProxy();\n await childProcess.start({\n command: 'npx',\n arguments: args,\n spawn: options\n });\n return outputUrl;\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { VERSION } from \"./lib/utils/version.js\";\nimport { encodeImageURLToCompressedTextureURL } from \"./lib/encoders/encode-texture.js\";\n/**\n * DDS Texture Container Exporter\n */\nexport const CompressedTextureWriter = {\n name: 'DDS Texture Container',\n id: 'dds',\n module: 'textures',\n version: VERSION,\n extensions: ['dds'],\n options: {\n texture: {\n format: 'auto',\n compression: 'auto',\n quality: 'auto',\n mipmap: false,\n flipY: false,\n toolFlags: ''\n }\n },\n encodeURLtoURL: encodeImageURLToCompressedTextureURL,\n encode() {\n throw new Error('Not implemented');\n }\n};\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { loadBasisEncoderModule } from \"../parsers/basis-module-loader.js\";\n/**\n * Encodes image to Basis Universal Supercompressed GPU Texture.\n * Code example is taken from here - https://github.com/BinomialLLC/basis_universal/blob/master/webgl/ktx2_encode_test/index.html#L279\n * BasisEncoder API - https://github.com/BinomialLLC/basis_universal/blob/master/webgl/transcoder/basis_wrappers.cpp#L1712\n * @param image\n * @param options\n */\nexport async function encodeKTX2BasisTexture(image, options = {}) {\n // TODO remove default values after writer options will be normalized like it done in load module.\n const { useSRGB = false, qualityLevel = 10, encodeUASTC = false, mipmaps = false } = options?.['ktx2-basis-writer'] || {};\n const { BasisEncoder } = await loadBasisEncoderModule(options);\n const basisEncoder = new BasisEncoder();\n try {\n const basisFileData = new Uint8Array(image.width * image.height * 4);\n basisEncoder.setCreateKTX2File(true);\n basisEncoder.setKTX2UASTCSupercompression(true);\n basisEncoder.setKTX2SRGBTransferFunc(true);\n basisEncoder.setSliceSourceImage(0, image.data, image.width, image.height, false);\n basisEncoder.setPerceptual(useSRGB);\n basisEncoder.setMipSRGB(useSRGB);\n basisEncoder.setQualityLevel(qualityLevel);\n basisEncoder.setUASTC(encodeUASTC);\n basisEncoder.setMipGen(mipmaps);\n const numOutputBytes = basisEncoder.encode(basisFileData);\n const actualKTX2FileData = basisFileData.subarray(0, numOutputBytes).buffer;\n return actualKTX2FileData;\n }\n catch (error) {\n // eslint-disable-next-line no-console\n console.error('Basis Universal Supercompressed GPU Texture encoder Error: ', error);\n throw error;\n }\n finally {\n basisEncoder.delete();\n }\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { VERSION } from \"./lib/utils/version.js\";\nimport { encodeKTX2BasisTexture } from \"./lib/encoders/encode-ktx2-basis-texture.js\";\n/**\n * Basis Universal Supercompressed GPU Texture.\n * Spec - https://github.com/Esri/i3s-spec/blob/master/docs/1.8/textureSetDefinitionFormat.cmn.md\n */\nexport const KTX2BasisWriter = {\n name: 'Basis Universal Supercompressed GPU Texture',\n id: 'ktx2-basis-writer',\n module: 'textures',\n version: VERSION,\n extensions: ['ktx2'],\n options: {\n ['ktx2-basis-writer']: {\n useSRGB: false,\n qualityLevel: 10,\n encodeUASTC: false,\n mipmaps: false\n }\n },\n encode: encodeKTX2BasisTexture\n};\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { assert } from '@loaders.gl/loader-utils';\nimport { ImageLoader, getImageSize } from '@loaders.gl/images';\nimport { generateUrl } from \"./generate-url.js\";\nimport { deepLoad, shallowLoad } from \"./deep-load.js\";\nexport async function loadImageTexture(getUrl, options = {}) {\n const imageUrls = await getImageUrls(getUrl, options);\n return await deepLoad(imageUrls, ImageLoader.parse, options);\n}\nexport async function getImageUrls(getUrl, options, urlOptions = {}) {\n const mipLevels = (options && options.image && options.image.mipLevels) || 0;\n return mipLevels !== 0\n ? await getMipmappedImageUrls(getUrl, mipLevels, options, urlOptions)\n : generateUrl(getUrl, options, urlOptions);\n}\nasync function getMipmappedImageUrls(getUrl, mipLevels, options, urlOptions) {\n const urls = [];\n // If no mip levels supplied, we need to load the level 0 image and calculate based on size\n if (mipLevels === 'auto') {\n const url = generateUrl(getUrl, options, { ...urlOptions, lod: 0 });\n const image = await shallowLoad(url, ImageLoader.parse, options);\n const { width, height } = getImageSize(image);\n mipLevels = getMipLevels({ width, height });\n // TODO - push image and make `deepLoad` pass through non-url values, avoid loading twice?\n urls.push(url);\n }\n // We now know how many mipLevels we need, remaining image urls can now be constructed\n assert(mipLevels > 0);\n for (let mipLevel = urls.length; mipLevel < mipLevels; ++mipLevel) {\n const url = generateUrl(getUrl, options, { ...urlOptions, lod: mipLevel });\n urls.push(url);\n }\n return urls;\n}\n// Calculates number of mipmaps based on texture size (log2)\nexport function getMipLevels(size) {\n return 1 + Math.floor(Math.log2(Math.max(size.width, size.height)));\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { resolvePath } from '@loaders.gl/loader-utils';\n// Generate a url by calling getUrl with mix of options, applying options.baseUrl\nexport function generateUrl(getUrl, options, urlOptions) {\n // Get url\n let url = typeof getUrl === 'function' ? getUrl({ ...options, ...urlOptions }) : getUrl;\n // Apply options.baseUrl\n const baseUrl = options.baseUrl;\n if (baseUrl) {\n url = baseUrl[baseUrl.length - 1] === '/' ? `${baseUrl}${url}` : `${baseUrl}/${url}`;\n }\n return resolvePath(url);\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nconst isObject = (value) => value && typeof value === 'object';\n// Loads a deep structure of urls (objects and arrays of urls)\n// Returns an object with six key-value pairs containing the images (or image mip arrays)\n// for each cube face\nexport async function asyncDeepMap(tree, func, options = {}) {\n return await mapSubtree(tree, func, options);\n}\nexport async function mapSubtree(object, func, options) {\n if (Array.isArray(object)) {\n return await mapArray(object, func, options);\n }\n if (isObject(object)) {\n return await mapObject(object, func, options);\n }\n // TODO - ignore non-urls, non-arraybuffers?\n const url = object;\n return await func(url, options);\n}\n// HELPERS\nasync function mapObject(object, func, options) {\n const promises = [];\n const values = {};\n for (const key in object) {\n const url = object[key];\n const promise = mapSubtree(url, func, options).then((value) => {\n values[key] = value;\n });\n promises.push(promise);\n }\n await Promise.all(promises);\n return values;\n}\nasync function mapArray(urlArray, func, options = {}) {\n const promises = urlArray.map((url) => mapSubtree(url, func, options));\n return await Promise.all(promises);\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { asyncDeepMap } from \"./async-deep-map.js\";\nexport async function deepLoad(urlTree, load, options) {\n return await asyncDeepMap(urlTree, (url) => shallowLoad(url, load, options));\n}\nexport async function shallowLoad(url, load, options) {\n const response = await fetch(url, options.fetch);\n const arrayBuffer = await response.arrayBuffer();\n return await load(arrayBuffer, options);\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { ImageLoader } from '@loaders.gl/images';\nimport { getImageUrls } from \"./load-image.js\";\nimport { deepLoad } from \"./deep-load.js\";\nexport async function loadImageTextureArray(count, getUrl, options = {}) {\n const imageUrls = await getImageArrayUrls(count, getUrl, options);\n return await deepLoad(imageUrls, ImageLoader.parse, options);\n}\nexport async function getImageArrayUrls(count, getUrl, options = {}) {\n const promises = [];\n for (let index = 0; index < count; index++) {\n const promise = getImageUrls(getUrl, options, { index });\n promises.push(promise);\n }\n return await Promise.all(promises);\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { ImageLoader } from '@loaders.gl/images';\nimport { getImageUrls } from \"./load-image.js\";\nimport { deepLoad } from \"./deep-load.js\";\n// Returned map will be have keys corresponding to GL cubemap constants\nconst GL_TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515;\nconst GL_TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516;\nconst GL_TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517;\nconst GL_TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518;\nconst GL_TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519;\nconst GL_TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851a;\nconst CUBE_FACES = [\n { face: GL_TEXTURE_CUBE_MAP_POSITIVE_X, direction: 'right', axis: 'x', sign: 'positive' },\n { face: GL_TEXTURE_CUBE_MAP_NEGATIVE_X, direction: 'left', axis: 'x', sign: 'negative' },\n { face: GL_TEXTURE_CUBE_MAP_POSITIVE_Y, direction: 'top', axis: 'y', sign: 'positive' },\n { face: GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, direction: 'bottom', axis: 'y', sign: 'negative' },\n { face: GL_TEXTURE_CUBE_MAP_POSITIVE_Z, direction: 'front', axis: 'z', sign: 'positive' },\n { face: GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, direction: 'back', axis: 'z', sign: 'negative' }\n];\n// Returns an object with six key-value pairs containing the urls (or url mip arrays)\n// for each cube face\nexport async function getImageCubeUrls(getUrl, options) {\n // Calculate URLs\n const urls = {};\n const promises = [];\n let index = 0;\n for (let i = 0; i < CUBE_FACES.length; ++i) {\n const face = CUBE_FACES[index];\n const promise = getImageUrls(getUrl, options, { ...face, index: index++ }).then((url) => {\n urls[face.face] = url;\n });\n promises.push(promise);\n }\n await Promise.all(promises);\n return urls;\n}\n// Returns an object with six key-value pairs containing the images (or image mip arrays)\n// for each cube face\nexport async function loadImageTextureCube(getUrl, options = {}) {\n const urls = await getImageCubeUrls(getUrl, options);\n return (await deepLoad(urls, ImageLoader.parse, options));\n}\n"], "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACMO,IAAM,UAAU,OAAiC,UAAU;;;ACHlE,0BAAqD;AACrD,0BAA4B;AACrB,IAAM,2BAA2B;AAAA;AAAA,EAEpC,YAAY;AAAA;AAAA,EAEZ,iBAAiB;AAAA;AAAA,EAEjB,SAAS;AAAA;A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,iBAAiB,QAAQ,SAAS;AAEpD,QAAM,OAAO,CAAC;AACd,QAAM,WAAW,CAAC;AAClB,MAAI,QAAQ;AACZ,WAAS,IAAI,GAAG,IAAI,WAAW,QAAQ,EAAE,GAAG;AACxC,UAAM,OAAO,WAAW,KAAK;AAC7B,UAAM,UAAU,aAAa,QAAQ,SAAS,EAAE,GAAG,MAAM,OAAO,QAAQ,CAAC,EAAE,KAAK,CAAC,QAAQ;AACrF,WAAK,KAAK,IAAI,IAAI;AAAA,IACtB,CAAC;AACD,aAAS,KAAK,OAAO;AAAA,EACzB;AACA,QAAM,QAAQ,IAAI,QAAQ;AAC1B,SAAO;AACX;AAGA,eAAsB,qBAAqB,QAAQ,UAAU,CAAC,GAAG;AAC7D,QAAM,OAAO,MAAM,iBAAiB,QAAQ,OAAO;AACnD,SAAQ,MAAM,SAAS,MAAM,2BAAY,OAAO,OAAO;AAC3D;;;A3B7BO,IAAM,wBAAwB;AAAA,EACjC,MAAM;AAAA,EACN,IAAI;AAAA,EACJ,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,YAAY,CAAC,MAAM;AAAA,EACnB,QAAQ;AAAA,EACR,SAAS;AAAA,IACL,SAAS;AAAA,IACT,cAAc;AAAA,IACd,aAAa;AAAA,IACb,SAAS;AAAA,EACb;AACJ;", "names": ["module", "import_loader_utils", "a", "b", "import_loader_utils", "import_worker_utils", "import_worker_utils", "import_loader_utils", "import_loader_utils", "import_images", "import_images"] }