1 line
80 KiB
Plaintext
1 line
80 KiB
Plaintext
|
{"version":3,"file":"transcodeKTX2.js","sources":["../../../../Source/Renderer/PixelDatatype.js","../../../../Source/Core/PixelFormat.js","../../../../Source/Core/VulkanConstants.js","../../../../Source/ThirdParty/ktx-parse.js","../../../../Source/WorkersES6/transcodeKTX2.js"],"sourcesContent":["import WebGLConstants from \"../Core/WebGLConstants.js\";\n\n/**\n * The data type of a pixel.\n *\n * @enum {Number}\n * @see PostProcessStage\n */\nconst PixelDatatype = {\n UNSIGNED_BYTE: WebGLConstants.UNSIGNED_BYTE,\n UNSIGNED_SHORT: WebGLConstants.UNSIGNED_SHORT,\n UNSIGNED_INT: WebGLConstants.UNSIGNED_INT,\n FLOAT: WebGLConstants.FLOAT,\n HALF_FLOAT: WebGLConstants.HALF_FLOAT_OES,\n UNSIGNED_INT_24_8: WebGLConstants.UNSIGNED_INT_24_8,\n UNSIGNED_SHORT_4_4_4_4: WebGLConstants.UNSIGNED_SHORT_4_4_4_4,\n UNSIGNED_SHORT_5_5_5_1: WebGLConstants.UNSIGNED_SHORT_5_5_5_1,\n UNSIGNED_SHORT_5_6_5: WebGLConstants.UNSIGNED_SHORT_5_6_5,\n};\n\n/**\n @private\n*/\nPixelDatatype.toWebGLConstant = function (pixelDatatype, context) {\n switch (pixelDatatype) {\n case PixelDatatype.UNSIGNED_BYTE:\n return WebGLConstants.UNSIGNED_BYTE;\n case PixelDatatype.UNSIGNED_SHORT:\n return WebGLConstants.UNSIGNED_SHORT;\n case PixelDatatype.UNSIGNED_INT:\n return WebGLConstants.UNSIGNED_INT;\n case PixelDatatype.FLOAT:\n return WebGLConstants.FLOAT;\n case PixelDatatype.HALF_FLOAT:\n return context.webgl2\n ? WebGLConstants.HALF_FLOAT\n : WebGLConstants.HALF_FLOAT_OES;\n case PixelDatatype.UNSIGNED_INT_24_8:\n return WebGLConstants.UNSIGNED_INT_24_8;\n case PixelDatatype.UNSIGNED_SHORT_4_4_4_4:\n return WebGLConstants.UNSIGNED_SHORT_4_4_4_4;\n case PixelDatatype.UNSIGNED_SHORT_5_5_5_1:\n return WebGLConstants.UNSIGNED_SHORT_5_5_5_1;\n case PixelDatatype.UNSIGNED_SHORT_5_6_5:\n return PixelDatatype.UNSIGNED_SHORT_5_6_5;\n }\n};\n\n/**\n @private\n*/\nPixelDatatype.isPacked = function (pixelDatatype) {\n return (\n pixelDatatype === PixelDatatype.UNSIGNED_INT_24_8 ||\n pixelDatatype === PixelDatatype.UNSIGNED_SHORT_4_4_4_4 ||\n pixelDatatype === PixelDatatype.UNSIGNED_SHORT_5_5_5_1 ||\n pixelDatatype === PixelDatatype.UNSIGNED_SHORT_5_6_5\n );\n};\n\n/**\n @private\n*/\nPixelDatatype.sizeInBytes = function (pixelDatatype) {\n switch (pixelDatatype) {\n case PixelDatatype.UNSIGNED_BYTE:\n return 1;\n case PixelDatatype.UNSIGNED_SHORT:\n case PixelDatatype.UNSIGNED_SHORT_4_4_4_4:\n case PixelDatatype.UNSIGNED_SHORT_5_5_5_1:\n case PixelDatatype.UNSIGNED_SHORT_5_6_5:\n case PixelDatatype.HALF_FLOAT:\n return 2;\n case PixelDatatype.UNSIGNED_INT:\n case PixelDatatype.FLOAT:\n case PixelDatatype.UNSIGNED_INT_24_8:\n return 4;\n }\n};\n\n/**\n @private\n*/\nPixelDatatype.validate = function (pixelDatatype) {\n return (\n pixelDatatype === PixelDatatype.UNSIGNED_BYTE ||\n pixelDatatype === PixelDatatype.UNSIGNED_SHORT ||\n pixelDatatype === PixelDatatype.UNSIGNED_INT ||\n pixelDatatype === PixelDatatype.FLOAT ||\n pixelDatatype === PixelDatatype.HALF_FLOAT ||\n pixelDatatype === PixelDatatype.UNSIGNED_INT_24_8 ||\n pixelDatatype === PixelDatatype.UNSIGNED_SHORT_4_4_4_4 ||\n pixelDatatype === PixelDatatype.UNSIGNED_SHORT_5_5_5_1 ||\n pixelDatatype === PixelDatatype.UNSIGNED_SHORT_5_6_5\n );\n};\n\nexport default Object.freeze(PixelDatatype);\n","import PixelDatatype from \"../Renderer/PixelDatatype.js\";\nimport WebGLConstants from \"./WebGLConstants.js\";\n\n/**\n * The format of a pixel, i.e., the number of components it has and what they represent.\n *\n * @enum {Number}\n */\nconst PixelFormat = {\n /**\n * A pixel format containing a depth value.\n *\n * @type {Number}\n * @constant\n */\n DEPTH_COMPONENT: WebGLConstants.DEPTH_COMPONENT,\n\n /**\n * A pixel format containing a depth and stencil value, most often used with {@link PixelDatatype.UNSIGNED_INT_24_8}.\n *\n * @type {Number}\n * @constant\n */\n DEPTH_STENCIL: WebGLConstants.DEPTH_STENCIL
|