sdfsdfs
This commit is contained in:
28
node_modules/pixi.js/lib/_virtual/basis.worker.js
generated
vendored
Normal file
28
node_modules/pixi.js/lib/_virtual/basis.worker.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
const WORKER_CODE = "(function () {\n 'use strict';\n\n function createLevelBuffers(basisTexture, basisTranscoderFormat) {\n const images = basisTexture.getNumImages();\n const levels = basisTexture.getNumLevels(0);\n const success = basisTexture.startTranscoding();\n if (!success) {\n throw new Error(\"startTranscoding failed\");\n }\n const levelBuffers = [];\n for (let levelIndex = 0; levelIndex < levels; ++levelIndex) {\n for (let sliceIndex = 0; sliceIndex < images; ++sliceIndex) {\n const transcodeSize = basisTexture.getImageTranscodedSizeInBytes(sliceIndex, levelIndex, basisTranscoderFormat);\n const levelBuffer = new Uint8Array(transcodeSize);\n const success2 = basisTexture.transcodeImage(levelBuffer, sliceIndex, levelIndex, basisTranscoderFormat, 1, 0);\n if (!success2) {\n throw new Error(\"transcodeImage failed\");\n }\n levelBuffers.push(levelBuffer);\n }\n }\n return levelBuffers;\n }\n\n const gpuFormatToBasisTranscoderFormatMap = {\n \"bc3-rgba-unorm\": 3,\n // cTFBC3_RGBA\n \"bc7-rgba-unorm\": 6,\n // cTFBC7_RGBA,\n \"etc2-rgba8unorm\": 1,\n // cTFETC2_RGBA,\n \"astc-4x4-unorm\": 10,\n // cTFASTC_4x4_RGBA,\n // Uncompressed\n rgba8unorm: 13,\n // cTFRGBA32,\n rgba4unorm: 16\n // cTFRGBA4444,\n };\n function gpuFormatToBasisTranscoderFormat(transcoderFormat) {\n const format = gpuFormatToBasisTranscoderFormatMap[transcoderFormat];\n if (format) {\n return format;\n }\n throw new Error(`Unsupported transcoderFormat: ${transcoderFormat}`);\n }\n\n const settings = {\n jsUrl: \"basis/basis_transcoder.js\",\n wasmUrl: \"basis/basis_transcoder.wasm\"\n };\n let basisTranscoderFormat;\n let basisTranscodedTextureFormat;\n let basisPromise;\n async function getBasis() {\n if (!basisPromise) {\n const absoluteJsUrl = new URL(settings.jsUrl, location.origin).href;\n const absoluteWasmUrl = new URL(settings.wasmUrl, location.origin).href;\n importScripts(absoluteJsUrl);\n basisPromise = new Promise((resolve) => {\n BASIS({\n locateFile: (_file) => absoluteWasmUrl\n }).then((module) => {\n module.initializeBasis();\n resolve(module.BasisFile);\n });\n });\n }\n return basisPromise;\n }\n async function fetchBasisTexture(url, BasisTexture) {\n const basisResponse = await fetch(url);\n if (basisResponse.ok) {\n const basisArrayBuffer = await basisResponse.arrayBuffer();\n return new BasisTexture(new Uint8Array(basisArrayBuffer));\n }\n throw new Error(`Failed to load Basis texture: ${url}`);\n }\n const preferredTranscodedFormat = [\n \"bc7-rgba-unorm\",\n \"astc-4x4-unorm\",\n \"etc2-rgba8unorm\",\n \"bc3-rgba-unorm\",\n \"rgba8unorm\"\n ];\n async function load(url) {\n const BasisTexture = await getBasis();\n const basisTexture = await fetchBasisTexture(url, BasisTexture);\n const levelBuffers = createLevelBuffers(basisTexture, basisTranscoderFormat);\n return {\n width: basisTexture.getImageWidth(0, 0),\n height: basisTexture.getImageHeight(0, 0),\n format: basisTranscodedTextureFormat,\n resource: levelBuffers,\n alphaMode: \"no-premultiply-alpha\"\n };\n }\n async function init(jsUrl, wasmUrl, supportedTextures) {\n if (jsUrl)\n settings.jsUrl = jsUrl;\n if (wasmUrl)\n settings.wasmUrl = wasmUrl;\n basisTranscodedTextureFormat = preferredTranscodedFormat.filter((format) => supportedTextures.includes(format))[0];\n basisTranscoderFormat = gpuFormatToBasisTranscoderFormat(basisTranscodedTextureFormat);\n await getBasis();\n }\n const messageHandlers = {\n init: async (data) => {\n const { jsUrl, wasmUrl, supportedTextures } = data;\n await init(jsUrl, wasmUrl, supportedTextures);\n },\n load: async (data) => {\n try {\n const textureOptions = await load(data.url);\n return {\n type: \"load\",\n url: data.url,\n success: true,\n textureOptions,\n transferables: textureOptions.resource?.map((arr) => arr.buffer)\n };\n } catch (e) {\n throw e;\n }\n }\n };\n self.onmessage = async (messageEvent) => {\n const message = messageEvent.data;\n const response = await messageHandlers[message.type](message);\n if (response) {\n self.postMessage(response, response.transferables);\n }\n };\n\n})();\n";
|
||||
let WORKER_URL = null;
|
||||
class WorkerInstance
|
||||
{
|
||||
constructor()
|
||||
{
|
||||
if (!WORKER_URL)
|
||||
{
|
||||
WORKER_URL = URL.createObjectURL(new Blob([WORKER_CODE], { type: 'application/javascript' }));
|
||||
}
|
||||
this.worker = new Worker(WORKER_URL);
|
||||
}
|
||||
}
|
||||
WorkerInstance.revokeObjectURL = function revokeObjectURL()
|
||||
{
|
||||
if (WORKER_URL)
|
||||
{
|
||||
URL.revokeObjectURL(WORKER_URL);
|
||||
WORKER_URL = null;
|
||||
}
|
||||
};
|
||||
|
||||
exports.default = WorkerInstance;
|
||||
//# sourceMappingURL=basis.worker.js.map
|
1
node_modules/pixi.js/lib/_virtual/basis.worker.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/_virtual/basis.worker.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"basis.worker.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
24
node_modules/pixi.js/lib/_virtual/basis.worker.mjs
generated
vendored
Normal file
24
node_modules/pixi.js/lib/_virtual/basis.worker.mjs
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
const WORKER_CODE = "(function () {\n 'use strict';\n\n function createLevelBuffers(basisTexture, basisTranscoderFormat) {\n const images = basisTexture.getNumImages();\n const levels = basisTexture.getNumLevels(0);\n const success = basisTexture.startTranscoding();\n if (!success) {\n throw new Error(\"startTranscoding failed\");\n }\n const levelBuffers = [];\n for (let levelIndex = 0; levelIndex < levels; ++levelIndex) {\n for (let sliceIndex = 0; sliceIndex < images; ++sliceIndex) {\n const transcodeSize = basisTexture.getImageTranscodedSizeInBytes(sliceIndex, levelIndex, basisTranscoderFormat);\n const levelBuffer = new Uint8Array(transcodeSize);\n const success2 = basisTexture.transcodeImage(levelBuffer, sliceIndex, levelIndex, basisTranscoderFormat, 1, 0);\n if (!success2) {\n throw new Error(\"transcodeImage failed\");\n }\n levelBuffers.push(levelBuffer);\n }\n }\n return levelBuffers;\n }\n\n const gpuFormatToBasisTranscoderFormatMap = {\n \"bc3-rgba-unorm\": 3,\n // cTFBC3_RGBA\n \"bc7-rgba-unorm\": 6,\n // cTFBC7_RGBA,\n \"etc2-rgba8unorm\": 1,\n // cTFETC2_RGBA,\n \"astc-4x4-unorm\": 10,\n // cTFASTC_4x4_RGBA,\n // Uncompressed\n rgba8unorm: 13,\n // cTFRGBA32,\n rgba4unorm: 16\n // cTFRGBA4444,\n };\n function gpuFormatToBasisTranscoderFormat(transcoderFormat) {\n const format = gpuFormatToBasisTranscoderFormatMap[transcoderFormat];\n if (format) {\n return format;\n }\n throw new Error(`Unsupported transcoderFormat: ${transcoderFormat}`);\n }\n\n const settings = {\n jsUrl: \"basis/basis_transcoder.js\",\n wasmUrl: \"basis/basis_transcoder.wasm\"\n };\n let basisTranscoderFormat;\n let basisTranscodedTextureFormat;\n let basisPromise;\n async function getBasis() {\n if (!basisPromise) {\n const absoluteJsUrl = new URL(settings.jsUrl, location.origin).href;\n const absoluteWasmUrl = new URL(settings.wasmUrl, location.origin).href;\n importScripts(absoluteJsUrl);\n basisPromise = new Promise((resolve) => {\n BASIS({\n locateFile: (_file) => absoluteWasmUrl\n }).then((module) => {\n module.initializeBasis();\n resolve(module.BasisFile);\n });\n });\n }\n return basisPromise;\n }\n async function fetchBasisTexture(url, BasisTexture) {\n const basisResponse = await fetch(url);\n if (basisResponse.ok) {\n const basisArrayBuffer = await basisResponse.arrayBuffer();\n return new BasisTexture(new Uint8Array(basisArrayBuffer));\n }\n throw new Error(`Failed to load Basis texture: ${url}`);\n }\n const preferredTranscodedFormat = [\n \"bc7-rgba-unorm\",\n \"astc-4x4-unorm\",\n \"etc2-rgba8unorm\",\n \"bc3-rgba-unorm\",\n \"rgba8unorm\"\n ];\n async function load(url) {\n const BasisTexture = await getBasis();\n const basisTexture = await fetchBasisTexture(url, BasisTexture);\n const levelBuffers = createLevelBuffers(basisTexture, basisTranscoderFormat);\n return {\n width: basisTexture.getImageWidth(0, 0),\n height: basisTexture.getImageHeight(0, 0),\n format: basisTranscodedTextureFormat,\n resource: levelBuffers,\n alphaMode: \"no-premultiply-alpha\"\n };\n }\n async function init(jsUrl, wasmUrl, supportedTextures) {\n if (jsUrl)\n settings.jsUrl = jsUrl;\n if (wasmUrl)\n settings.wasmUrl = wasmUrl;\n basisTranscodedTextureFormat = preferredTranscodedFormat.filter((format) => supportedTextures.includes(format))[0];\n basisTranscoderFormat = gpuFormatToBasisTranscoderFormat(basisTranscodedTextureFormat);\n await getBasis();\n }\n const messageHandlers = {\n init: async (data) => {\n const { jsUrl, wasmUrl, supportedTextures } = data;\n await init(jsUrl, wasmUrl, supportedTextures);\n },\n load: async (data) => {\n try {\n const textureOptions = await load(data.url);\n return {\n type: \"load\",\n url: data.url,\n success: true,\n textureOptions,\n transferables: textureOptions.resource?.map((arr) => arr.buffer)\n };\n } catch (e) {\n throw e;\n }\n }\n };\n self.onmessage = async (messageEvent) => {\n const message = messageEvent.data;\n const response = await messageHandlers[message.type](message);\n if (response) {\n self.postMessage(response, response.transferables);\n }\n };\n\n})();\n";
|
||||
let WORKER_URL = null;
|
||||
class WorkerInstance
|
||||
{
|
||||
constructor()
|
||||
{
|
||||
if (!WORKER_URL)
|
||||
{
|
||||
WORKER_URL = URL.createObjectURL(new Blob([WORKER_CODE], { type: 'application/javascript' }));
|
||||
}
|
||||
this.worker = new Worker(WORKER_URL);
|
||||
}
|
||||
}
|
||||
WorkerInstance.revokeObjectURL = function revokeObjectURL()
|
||||
{
|
||||
if (WORKER_URL)
|
||||
{
|
||||
URL.revokeObjectURL(WORKER_URL);
|
||||
WORKER_URL = null;
|
||||
}
|
||||
};
|
||||
|
||||
export { WorkerInstance as default };
|
||||
//# sourceMappingURL=basis.worker.mjs.map
|
1
node_modules/pixi.js/lib/_virtual/basis.worker.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/_virtual/basis.worker.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"basis.worker.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;"}
|
28
node_modules/pixi.js/lib/_virtual/checkImageBitmap.worker.js
generated
vendored
Normal file
28
node_modules/pixi.js/lib/_virtual/checkImageBitmap.worker.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
const WORKER_CODE = "(function () {\n 'use strict';\n\n const WHITE_PNG = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII=\";\n async function checkImageBitmap() {\n try {\n if (typeof createImageBitmap !== \"function\")\n return false;\n const response = await fetch(WHITE_PNG);\n const imageBlob = await response.blob();\n const imageBitmap = await createImageBitmap(imageBlob);\n return imageBitmap.width === 1 && imageBitmap.height === 1;\n } catch (e) {\n return false;\n }\n }\n void checkImageBitmap().then((result) => {\n self.postMessage(result);\n });\n\n})();\n";
|
||||
let WORKER_URL = null;
|
||||
class WorkerInstance
|
||||
{
|
||||
constructor()
|
||||
{
|
||||
if (!WORKER_URL)
|
||||
{
|
||||
WORKER_URL = URL.createObjectURL(new Blob([WORKER_CODE], { type: 'application/javascript' }));
|
||||
}
|
||||
this.worker = new Worker(WORKER_URL);
|
||||
}
|
||||
}
|
||||
WorkerInstance.revokeObjectURL = function revokeObjectURL()
|
||||
{
|
||||
if (WORKER_URL)
|
||||
{
|
||||
URL.revokeObjectURL(WORKER_URL);
|
||||
WORKER_URL = null;
|
||||
}
|
||||
};
|
||||
|
||||
exports.default = WorkerInstance;
|
||||
//# sourceMappingURL=checkImageBitmap.worker.js.map
|
1
node_modules/pixi.js/lib/_virtual/checkImageBitmap.worker.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/_virtual/checkImageBitmap.worker.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"checkImageBitmap.worker.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
24
node_modules/pixi.js/lib/_virtual/checkImageBitmap.worker.mjs
generated
vendored
Normal file
24
node_modules/pixi.js/lib/_virtual/checkImageBitmap.worker.mjs
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
const WORKER_CODE = "(function () {\n 'use strict';\n\n const WHITE_PNG = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII=\";\n async function checkImageBitmap() {\n try {\n if (typeof createImageBitmap !== \"function\")\n return false;\n const response = await fetch(WHITE_PNG);\n const imageBlob = await response.blob();\n const imageBitmap = await createImageBitmap(imageBlob);\n return imageBitmap.width === 1 && imageBitmap.height === 1;\n } catch (e) {\n return false;\n }\n }\n void checkImageBitmap().then((result) => {\n self.postMessage(result);\n });\n\n})();\n";
|
||||
let WORKER_URL = null;
|
||||
class WorkerInstance
|
||||
{
|
||||
constructor()
|
||||
{
|
||||
if (!WORKER_URL)
|
||||
{
|
||||
WORKER_URL = URL.createObjectURL(new Blob([WORKER_CODE], { type: 'application/javascript' }));
|
||||
}
|
||||
this.worker = new Worker(WORKER_URL);
|
||||
}
|
||||
}
|
||||
WorkerInstance.revokeObjectURL = function revokeObjectURL()
|
||||
{
|
||||
if (WORKER_URL)
|
||||
{
|
||||
URL.revokeObjectURL(WORKER_URL);
|
||||
WORKER_URL = null;
|
||||
}
|
||||
};
|
||||
|
||||
export { WorkerInstance as default };
|
||||
//# sourceMappingURL=checkImageBitmap.worker.mjs.map
|
1
node_modules/pixi.js/lib/_virtual/checkImageBitmap.worker.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/_virtual/checkImageBitmap.worker.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"checkImageBitmap.worker.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;"}
|
28
node_modules/pixi.js/lib/_virtual/ktx.worker.js
generated
vendored
Normal file
28
node_modules/pixi.js/lib/_virtual/ktx.worker.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
node_modules/pixi.js/lib/_virtual/ktx.worker.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/_virtual/ktx.worker.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ktx.worker.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
24
node_modules/pixi.js/lib/_virtual/ktx.worker.mjs
generated
vendored
Normal file
24
node_modules/pixi.js/lib/_virtual/ktx.worker.mjs
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
node_modules/pixi.js/lib/_virtual/ktx.worker.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/_virtual/ktx.worker.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ktx.worker.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;"}
|
28
node_modules/pixi.js/lib/_virtual/loadImageBitmap.worker.js
generated
vendored
Normal file
28
node_modules/pixi.js/lib/_virtual/loadImageBitmap.worker.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
const WORKER_CODE = "(function () {\n 'use strict';\n\n async function loadImageBitmap(url, alphaMode) {\n const response = await fetch(url);\n if (!response.ok) {\n throw new Error(`[WorkerManager.loadImageBitmap] Failed to fetch ${url}: ${response.status} ${response.statusText}`);\n }\n const imageBlob = await response.blob();\n return alphaMode === \"premultiplied-alpha\" ? createImageBitmap(imageBlob, { premultiplyAlpha: \"none\" }) : createImageBitmap(imageBlob);\n }\n self.onmessage = async (event) => {\n try {\n const imageBitmap = await loadImageBitmap(event.data.data[0], event.data.data[1]);\n self.postMessage({\n data: imageBitmap,\n uuid: event.data.uuid,\n id: event.data.id\n }, [imageBitmap]);\n } catch (e) {\n self.postMessage({\n error: e,\n uuid: event.data.uuid,\n id: event.data.id\n });\n }\n };\n\n})();\n";
|
||||
let WORKER_URL = null;
|
||||
class WorkerInstance
|
||||
{
|
||||
constructor()
|
||||
{
|
||||
if (!WORKER_URL)
|
||||
{
|
||||
WORKER_URL = URL.createObjectURL(new Blob([WORKER_CODE], { type: 'application/javascript' }));
|
||||
}
|
||||
this.worker = new Worker(WORKER_URL);
|
||||
}
|
||||
}
|
||||
WorkerInstance.revokeObjectURL = function revokeObjectURL()
|
||||
{
|
||||
if (WORKER_URL)
|
||||
{
|
||||
URL.revokeObjectURL(WORKER_URL);
|
||||
WORKER_URL = null;
|
||||
}
|
||||
};
|
||||
|
||||
exports.default = WorkerInstance;
|
||||
//# sourceMappingURL=loadImageBitmap.worker.js.map
|
1
node_modules/pixi.js/lib/_virtual/loadImageBitmap.worker.js.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/_virtual/loadImageBitmap.worker.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"loadImageBitmap.worker.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
24
node_modules/pixi.js/lib/_virtual/loadImageBitmap.worker.mjs
generated
vendored
Normal file
24
node_modules/pixi.js/lib/_virtual/loadImageBitmap.worker.mjs
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
const WORKER_CODE = "(function () {\n 'use strict';\n\n async function loadImageBitmap(url, alphaMode) {\n const response = await fetch(url);\n if (!response.ok) {\n throw new Error(`[WorkerManager.loadImageBitmap] Failed to fetch ${url}: ${response.status} ${response.statusText}`);\n }\n const imageBlob = await response.blob();\n return alphaMode === \"premultiplied-alpha\" ? createImageBitmap(imageBlob, { premultiplyAlpha: \"none\" }) : createImageBitmap(imageBlob);\n }\n self.onmessage = async (event) => {\n try {\n const imageBitmap = await loadImageBitmap(event.data.data[0], event.data.data[1]);\n self.postMessage({\n data: imageBitmap,\n uuid: event.data.uuid,\n id: event.data.id\n }, [imageBitmap]);\n } catch (e) {\n self.postMessage({\n error: e,\n uuid: event.data.uuid,\n id: event.data.id\n });\n }\n };\n\n})();\n";
|
||||
let WORKER_URL = null;
|
||||
class WorkerInstance
|
||||
{
|
||||
constructor()
|
||||
{
|
||||
if (!WORKER_URL)
|
||||
{
|
||||
WORKER_URL = URL.createObjectURL(new Blob([WORKER_CODE], { type: 'application/javascript' }));
|
||||
}
|
||||
this.worker = new Worker(WORKER_URL);
|
||||
}
|
||||
}
|
||||
WorkerInstance.revokeObjectURL = function revokeObjectURL()
|
||||
{
|
||||
if (WORKER_URL)
|
||||
{
|
||||
URL.revokeObjectURL(WORKER_URL);
|
||||
WORKER_URL = null;
|
||||
}
|
||||
};
|
||||
|
||||
export { WorkerInstance as default };
|
||||
//# sourceMappingURL=loadImageBitmap.worker.mjs.map
|
1
node_modules/pixi.js/lib/_virtual/loadImageBitmap.worker.mjs.map
generated
vendored
Normal file
1
node_modules/pixi.js/lib/_virtual/loadImageBitmap.worker.mjs.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"loadImageBitmap.worker.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;"}
|
Reference in New Issue
Block a user