@geoinsight/react-components 1.0.4 → 1.0.6
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.
- package/.pnp.cjs +2014 -3638
- package/.yarn/install-state.gz +0 -0
- package/.yarn/unplugged/{@swc-core-linux-x64-gnu-npm-1.3.106-7bb327124d → @swc-core-linux-x64-gnu-npm-1.4.0-07735121da}/node_modules/@swc/core-linux-x64-gnu/package.json +1 -1
- package/.yarn/unplugged/{@swc-core-linux-x64-gnu-npm-1.3.106-7bb327124d → @swc-core-linux-x64-gnu-npm-1.4.0-07735121da}/node_modules/@swc/core-linux-x64-gnu/swc.linux-x64-gnu.node +0 -0
- package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/CHANGELOG.md +70 -85
- package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/package.json +11 -11
- package/dist/cjs/components/button/index.stories.d.ts +12 -9
- package/dist/cjs/components/map/map-mapbox.d.ts +0 -1
- package/dist/cjs/index.css +67 -184
- package/dist/cjs/index.d.ts +0 -3
- package/dist/cjs/index.js +47 -213
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/components/button/index.stories.d.ts +12 -9
- package/dist/esm/components/map/map-mapbox.d.ts +0 -1
- package/dist/esm/index.css +67 -184
- package/dist/esm/index.d.ts +0 -3
- package/dist/esm/index.js +49 -192
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -5
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/.ready +0 -0
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/LICENSE.txt +0 -116
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/README.md +0 -149
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/build/banner.ts +0 -4
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/build/check-bundle-size.js +0 -77
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/build/generate-debug-index-file.ts +0 -19
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/build/generate-query-test-fixtures.ts +0 -126
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/build/generate-shaders.ts +0 -35
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/build/generate-struct-arrays.ts +0 -437
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/build/generate-style-code.ts +0 -280
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/build/generate-style-spec.ts +0 -323
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/build/generate-typings.ts +0 -26
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/build/readme.md +0 -52
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/build/release-notes.js +0 -45
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/build/rollup_plugin_minify_style_spec.ts +0 -25
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/build/rollup_plugins.ts +0 -52
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/dist/maplibre-gl-csp-worker.js +0 -2
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/dist/maplibre-gl-csp-worker.js.map +0 -1
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/dist/maplibre-gl-csp.js +0 -2
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/dist/maplibre-gl-csp.js.map +0 -1
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/dist/maplibre-gl-dev.js +0 -51935
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/dist/maplibre-gl.css +0 -1
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/dist/maplibre-gl.d.ts +0 -11736
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/dist/maplibre-gl.js +0 -44
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/dist/maplibre-gl.js.map +0 -1
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/dist/package.json +0 -1
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/dist/style-spec/index.d.ts +0 -1768
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/package.json +0 -182
- package/.yarn/unplugged/maplibre-gl-npm-2.4.0-9fa603cf50/node_modules/maplibre-gl/postinstall.js +0 -1
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/.editorconfig +0 -7
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/.ready +0 -0
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/LICENSE +0 -21
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/README.md +0 -108
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/darwin/LICENSE-PVRTexToolCLI.txt +0 -52
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/darwin/LICENSE-astcenc.txt +0 -137
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/darwin/LICENSE-crunch.txt +0 -25
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/darwin/PVRTexToolCLI +0 -0
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/darwin/astcenc +0 -0
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/darwin/crunch +0 -0
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/linux/LICENSE-PVRTexToolCLI.txt +0 -52
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/linux/LICENSE-astcenc.txt +0 -137
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/linux/LICENSE-crunch.txt +0 -25
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/linux/PVRTexToolCLI +0 -0
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/linux/astcenc +0 -0
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/linux/crunch +0 -0
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/texture-compressor.js +0 -3
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/win32/LICENSE-PVRTexToolCLI.txt +0 -52
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/win32/LICENSE-astcenc.txt +0 -137
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/win32/LICENSE-crunch.txt +0 -25
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/win32/PVRTexToolCLI.exe +0 -0
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/win32/astcenc.exe +0 -0
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/bin/win32/crunch.exe +0 -0
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/argsHandler.js +0 -101
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/argsHandler.js.map +0 -1
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/compressors/compressWithCrunch.js +0 -48
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/compressors/compressWithCrunch.js.map +0 -1
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/compressors/compressWithPVRTexTool.js +0 -51
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/compressors/compressWithPVRTexTool.js.map +0 -1
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/compressors/spawnProcess.js +0 -45
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/compressors/spawnProcess.js.map +0 -1
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/compressors/validateArgs.js +0 -36
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/compressors/validateArgs.js.map +0 -1
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/constants.js +0 -85
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/constants.js.map +0 -1
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/index.js +0 -33
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/index.js.map +0 -1
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/utilities.js +0 -52
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/lib/utilities.js.map +0 -1
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/cli/package.json +0 -37
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/types/lib/argsHandler.d.ts +0 -14
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/types/lib/compressors/compressWithCrunch.d.ts +0 -5
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/types/lib/compressors/compressWithPVRTexTool.d.ts +0 -5
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/types/lib/compressors/spawnProcess.d.ts +0 -9
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/types/lib/compressors/validateArgs.d.ts +0 -11
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/types/lib/constants.d.ts +0 -45
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/types/lib/index.d.ts +0 -5
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/dist/types/lib/utilities.d.ts +0 -43
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/RECOMMENDED_PARAMETERS.md +0 -17
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/SUPPORTED_DEVICES_TABLE.md +0 -47
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/SUPPORTED_PARAMETERS.md +0 -154
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/data/KTXLoader.js +0 -149
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/data/flippedY-mipmaps/example-astc-4x4.ktx +0 -0
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/data/flippedY-mipmaps/example-astc-8x8.ktx +0 -0
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/data/flippedY-mipmaps/example-dxt1.ktx +0 -0
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/data/flippedY-mipmaps/example-dxt1A.ktx +0 -0
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/data/flippedY-mipmaps/example-dxt3.ktx +0 -0
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/data/flippedY-mipmaps/example-dxt5.ktx +0 -0
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/data/flippedY-mipmaps/example-etc1.ktx +0 -0
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/data/flippedY-mipmaps/example-etc2.ktx +0 -0
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/data/flippedY-mipmaps/example-etc2A.ktx +0 -0
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/data/flippedY-mipmaps/example-pvrtc2BPP.ktx +0 -0
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/data/flippedY-mipmaps/example-pvrtc2BPPA.ktx +0 -0
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/data/flippedY-mipmaps/example-pvrtc4BPP.ktx +0 -0
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/data/flippedY-mipmaps/example-pvrtc4BPPA.ktx +0 -0
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/data/main.js +0 -195
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/docs/index.html +0 -37
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/lib/argsHandler.ts +0 -135
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/lib/compressors/compressWithCrunch.ts +0 -66
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/lib/compressors/compressWithPVRTexTool.ts +0 -91
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/lib/compressors/spawnProcess.ts +0 -57
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/lib/compressors/validateArgs.ts +0 -53
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/lib/constants.ts +0 -86
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/lib/index.ts +0 -37
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/lib/utilities.ts +0 -57
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/package.json +0 -37
- package/.yarn/unplugged/texture-compressor-npm-1.0.2-c655a54095/node_modules/texture-compressor/tslint.json +0 -12
- /package/.yarn/unplugged/{@swc-core-linux-x64-gnu-npm-1.3.106-7bb327124d → @swc-core-linux-x64-gnu-npm-1.4.0-07735121da}/node_modules/@swc/core-linux-x64-gnu/.ready +0 -0
- /package/.yarn/unplugged/{@swc-core-linux-x64-gnu-npm-1.3.106-7bb327124d → @swc-core-linux-x64-gnu-npm-1.4.0-07735121da}/node_modules/@swc/core-linux-x64-gnu/README.md +0 -0
- /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/.ready +0 -0
- /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/LICENSE +0 -0
- /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/README.md +0 -0
- /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/Visitor.d.ts +0 -0
- /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/Visitor.js +0 -0
- /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/binding.d.ts +0 -0
- /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/binding.js +0 -0
- /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/bindings/README.md +0 -0
- /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/bindings/binding_core_wasm/package.json +0 -0
- /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/index.d.ts +0 -0
- /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/index.js +0 -0
- /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/postinstall.js +0 -0
- /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/spack.d.ts +0 -0
- /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/spack.js +0 -0
- /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/util.d.ts +0 -0
- /package/.yarn/unplugged/{@swc-core-virtual-22cde85fc1 → @swc-core-virtual-a4869543ec}/node_modules/@swc/core/util.js +0 -0
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
// Vendor
|
|
2
|
-
import { ArgumentParser } from 'argparse';
|
|
3
|
-
|
|
4
|
-
// Package
|
|
5
|
-
import * as pkg from '../package.json';
|
|
6
|
-
|
|
7
|
-
// Constants
|
|
8
|
-
import {
|
|
9
|
-
ASTC_COMPRESSION_TYPES,
|
|
10
|
-
ASTC_QUALITY_TYPES,
|
|
11
|
-
COMPRESSION_FORMAT_FLAGS,
|
|
12
|
-
ETC_COMPRESSION_TYPES,
|
|
13
|
-
ETC_QUALITY_TYPES,
|
|
14
|
-
IS_ASTC,
|
|
15
|
-
IS_ETC,
|
|
16
|
-
IS_PVRTC,
|
|
17
|
-
IS_S3TC,
|
|
18
|
-
PVRTC_COMPRESSION_TYPES,
|
|
19
|
-
PVRTC_QUALITY_TYPES,
|
|
20
|
-
S3TC_COMPRESSION_TYPES,
|
|
21
|
-
S3TC_QUALITY_TYPES,
|
|
22
|
-
} from './constants';
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Create CLI arguments
|
|
26
|
-
*/
|
|
27
|
-
const createParserArguments = (): ICLIArgs => {
|
|
28
|
-
const parser = new ArgumentParser({
|
|
29
|
-
addHelp: true,
|
|
30
|
-
description: pkg.description,
|
|
31
|
-
version: pkg.version,
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
// File input flag
|
|
35
|
-
parser.addArgument(['-i', '--input'], {
|
|
36
|
-
help: 'Input file including path',
|
|
37
|
-
required: false,
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
// File output flag
|
|
41
|
-
parser.addArgument(['-o', '--output'], {
|
|
42
|
-
help: 'Output location including path',
|
|
43
|
-
required: true,
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
// Compression format flag
|
|
47
|
-
parser.addArgument(['-t', '--type'], {
|
|
48
|
-
choices: COMPRESSION_FORMAT_FLAGS,
|
|
49
|
-
help: 'Compression format',
|
|
50
|
-
required: true,
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
// Compression internal format flag
|
|
54
|
-
parser.addArgument(['-c', '--compression'], {
|
|
55
|
-
choices: [
|
|
56
|
-
...(IS_ASTC ? ASTC_COMPRESSION_TYPES : []),
|
|
57
|
-
...(IS_ETC ? ETC_COMPRESSION_TYPES : []),
|
|
58
|
-
...(IS_PVRTC ? PVRTC_COMPRESSION_TYPES : []),
|
|
59
|
-
...(IS_S3TC ? S3TC_COMPRESSION_TYPES : []),
|
|
60
|
-
],
|
|
61
|
-
help: 'Compression internal format',
|
|
62
|
-
required: true,
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
// Quality flag
|
|
66
|
-
parser.addArgument(['-q', '--quality'], {
|
|
67
|
-
choices: [
|
|
68
|
-
...(IS_ASTC ? ASTC_QUALITY_TYPES : []),
|
|
69
|
-
...(IS_ETC ? ETC_QUALITY_TYPES : []),
|
|
70
|
-
...(IS_PVRTC ? PVRTC_QUALITY_TYPES : []),
|
|
71
|
-
...(IS_S3TC ? S3TC_QUALITY_TYPES : []),
|
|
72
|
-
],
|
|
73
|
-
help: 'Quality type',
|
|
74
|
-
required: true,
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
// Mipmapping flag
|
|
78
|
-
parser.addArgument(['-m', '--mipmap'], {
|
|
79
|
-
action: 'storeTrue',
|
|
80
|
-
help: 'Enable mipmapping',
|
|
81
|
-
required: false,
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
// Vertical flip flag
|
|
85
|
-
parser.addArgument(['-y', '--flipY'], {
|
|
86
|
-
action: 'storeTrue',
|
|
87
|
-
help: 'Output file flipped vertically',
|
|
88
|
-
required: false,
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
// Resize square flag
|
|
92
|
-
parser.addArgument(['-rs', '--square'], {
|
|
93
|
-
choices: ['no', '-', '+'],
|
|
94
|
-
help: 'Force the texture into a square (default: +)',
|
|
95
|
-
required: false,
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
// Resize power of two flag
|
|
99
|
-
parser.addArgument(['-rp', '--pot'], {
|
|
100
|
-
choices: ['no', '-', '+'],
|
|
101
|
-
help: 'Force the texture into power of two dimensions (default: +)',
|
|
102
|
-
required: false,
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
// Arbitrary flags to pass on to specific tool
|
|
106
|
-
parser.addArgument(['-f', '--flags'], {
|
|
107
|
-
help: 'Any flags you want to directly pass to the compression tool',
|
|
108
|
-
nargs: '*',
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
// Verbose logging
|
|
112
|
-
parser.addArgument(['-vb', '--verbose'], {
|
|
113
|
-
action: 'storeTrue',
|
|
114
|
-
help: 'Enable verbose logging',
|
|
115
|
-
required: false,
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
return parser.parseArgs();
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
export interface ICLIArgs {
|
|
122
|
-
input: string;
|
|
123
|
-
output: string;
|
|
124
|
-
type: string;
|
|
125
|
-
compression: string;
|
|
126
|
-
quality: string;
|
|
127
|
-
mipmap?: boolean;
|
|
128
|
-
flipY?: boolean;
|
|
129
|
-
square?: string;
|
|
130
|
-
pot?: string;
|
|
131
|
-
flags?: string[] | null;
|
|
132
|
-
verbose?: boolean;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
export const CLIArgs = createParserArguments();
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
// Native
|
|
2
|
-
import { cpus } from 'os';
|
|
3
|
-
|
|
4
|
-
// Arguments
|
|
5
|
-
import { ICLIArgs } from '../argsHandler';
|
|
6
|
-
|
|
7
|
-
// Compressors
|
|
8
|
-
import { spawnProcess } from './spawnProcess';
|
|
9
|
-
import { validateArgs } from './validateArgs';
|
|
10
|
-
|
|
11
|
-
// Constants
|
|
12
|
-
import {
|
|
13
|
-
S3TC,
|
|
14
|
-
S3TC_COMPRESSION_TYPES,
|
|
15
|
-
S3TC_QUALITY_TYPES,
|
|
16
|
-
S3TC_SUPPORTED_INPUT_TYPES,
|
|
17
|
-
S3TC_SUPPORTED_OUTPUT_TYPES,
|
|
18
|
-
} from '../constants';
|
|
19
|
-
|
|
20
|
-
// Utilities
|
|
21
|
-
import { getImageSize, getMipChainLevels } from '../utilities';
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Compress texture with the S3TC compression format
|
|
25
|
-
*/
|
|
26
|
-
export const compressWithCrunch = (args: ICLIArgs): Promise<any> => {
|
|
27
|
-
if (args.type === S3TC) {
|
|
28
|
-
validateArgs(
|
|
29
|
-
args,
|
|
30
|
-
S3TC_SUPPORTED_INPUT_TYPES,
|
|
31
|
-
S3TC_SUPPORTED_OUTPUT_TYPES,
|
|
32
|
-
S3TC_COMPRESSION_TYPES,
|
|
33
|
-
S3TC_QUALITY_TYPES
|
|
34
|
-
);
|
|
35
|
-
} else {
|
|
36
|
-
throw new Error('Unknown compression format');
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const flagMapping = [
|
|
40
|
-
'-file',
|
|
41
|
-
args.input,
|
|
42
|
-
'-out',
|
|
43
|
-
args.output,
|
|
44
|
-
'-fileformat',
|
|
45
|
-
'ktx',
|
|
46
|
-
`-${args.compression}`,
|
|
47
|
-
'-dxtQuality',
|
|
48
|
-
`${args.quality}`,
|
|
49
|
-
'-helperThreads',
|
|
50
|
-
cpus().length.toString(),
|
|
51
|
-
];
|
|
52
|
-
|
|
53
|
-
if (args.mipmap) {
|
|
54
|
-
const { width } = getImageSize(args.input);
|
|
55
|
-
flagMapping.push('-mipMode', 'Generate');
|
|
56
|
-
flagMapping.push('-maxmips', getMipChainLevels(width).toString());
|
|
57
|
-
} else {
|
|
58
|
-
flagMapping.push('-mipMode', 'None');
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
if (args.flipY) {
|
|
62
|
-
flagMapping.push('-yflip');
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
return spawnProcess(args, flagMapping, 'crunch');
|
|
66
|
-
};
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
// Arguments
|
|
2
|
-
import { ICLIArgs } from '../argsHandler';
|
|
3
|
-
|
|
4
|
-
// Compressors
|
|
5
|
-
import { spawnProcess } from './spawnProcess';
|
|
6
|
-
import { validateArgs } from './validateArgs';
|
|
7
|
-
|
|
8
|
-
// Constants
|
|
9
|
-
import {
|
|
10
|
-
ASTC,
|
|
11
|
-
ASTC_COMPRESSION_TYPES,
|
|
12
|
-
ASTC_QUALITY_TYPES,
|
|
13
|
-
ASTC_SUPPORTED_INPUT_TYPES,
|
|
14
|
-
ASTC_SUPPORTED_OUTPUT_TYPES,
|
|
15
|
-
ETC,
|
|
16
|
-
ETC_COMPRESSION_TYPES,
|
|
17
|
-
ETC_QUALITY_TYPES,
|
|
18
|
-
ETC_SUPPORTED_INPUT_TYPES,
|
|
19
|
-
ETC_SUPPORTED_OUTPUT_TYPES,
|
|
20
|
-
PVRTC,
|
|
21
|
-
PVRTC_COMPRESSION_TYPES,
|
|
22
|
-
PVRTC_QUALITY_TYPES,
|
|
23
|
-
PVRTC_SUPPORTED_INPUT_TYPES,
|
|
24
|
-
PVRTC_SUPPORTED_OUTPUT_TYPES,
|
|
25
|
-
} from '../constants';
|
|
26
|
-
|
|
27
|
-
// Utilities
|
|
28
|
-
import { getImageSize, getMipChainLevels } from '../utilities';
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Compress texture with the ASTC, ETC or PVRTC compression format
|
|
32
|
-
*/
|
|
33
|
-
export const compressWithPVRTexTool = (args: ICLIArgs): Promise<any> => {
|
|
34
|
-
if (args.type === ASTC) {
|
|
35
|
-
validateArgs(
|
|
36
|
-
args,
|
|
37
|
-
ASTC_SUPPORTED_INPUT_TYPES,
|
|
38
|
-
ASTC_SUPPORTED_OUTPUT_TYPES,
|
|
39
|
-
ASTC_COMPRESSION_TYPES,
|
|
40
|
-
ASTC_QUALITY_TYPES
|
|
41
|
-
);
|
|
42
|
-
} else if (args.type === ETC) {
|
|
43
|
-
validateArgs(
|
|
44
|
-
args,
|
|
45
|
-
ETC_SUPPORTED_INPUT_TYPES,
|
|
46
|
-
ETC_SUPPORTED_OUTPUT_TYPES,
|
|
47
|
-
ETC_COMPRESSION_TYPES,
|
|
48
|
-
ETC_QUALITY_TYPES
|
|
49
|
-
);
|
|
50
|
-
} else if (args.type === PVRTC) {
|
|
51
|
-
validateArgs(
|
|
52
|
-
args,
|
|
53
|
-
PVRTC_SUPPORTED_INPUT_TYPES,
|
|
54
|
-
PVRTC_SUPPORTED_OUTPUT_TYPES,
|
|
55
|
-
PVRTC_COMPRESSION_TYPES,
|
|
56
|
-
PVRTC_QUALITY_TYPES
|
|
57
|
-
);
|
|
58
|
-
} else {
|
|
59
|
-
throw new Error('Unknown compression format');
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
const flagMapping = [
|
|
63
|
-
'-i',
|
|
64
|
-
args.input,
|
|
65
|
-
'-o',
|
|
66
|
-
args.output,
|
|
67
|
-
'-f',
|
|
68
|
-
`${args.compression}`,
|
|
69
|
-
`-q`,
|
|
70
|
-
`${args.quality}`,
|
|
71
|
-
];
|
|
72
|
-
|
|
73
|
-
if (args.square !== 'no') {
|
|
74
|
-
flagMapping.push('-square', args.square || '+');
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
if (args.pot !== 'no') {
|
|
78
|
-
flagMapping.push('-pot', args.pot || '+');
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
if (args.mipmap) {
|
|
82
|
-
const { width } = getImageSize(args.input);
|
|
83
|
-
flagMapping.push('-m', getMipChainLevels(width).toString());
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
if (args.flipY) {
|
|
87
|
-
flagMapping.push('-flip', 'y');
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
return spawnProcess(args, flagMapping, 'PVRTexToolCLI');
|
|
91
|
-
};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
// Native
|
|
2
|
-
import { spawn } from 'child_process';
|
|
3
|
-
import { join } from 'path';
|
|
4
|
-
|
|
5
|
-
// Arguments
|
|
6
|
-
import { ICLIArgs } from '../argsHandler';
|
|
7
|
-
|
|
8
|
-
// Utilities
|
|
9
|
-
import { createFlagsForTool, getBinaryDirectory, splitFlagAndValue } from '../utilities';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Spawn a child process of a texture compression tool (e.g. PVRTexTool, Crunch)
|
|
13
|
-
*
|
|
14
|
-
* @param args Command line arguments
|
|
15
|
-
* @param flagMapping Flags to pass to the texture compression tool
|
|
16
|
-
* @param binaryName Name of the texture compression tool
|
|
17
|
-
*/
|
|
18
|
-
export const spawnProcess = (
|
|
19
|
-
args: ICLIArgs,
|
|
20
|
-
flagMapping: string[],
|
|
21
|
-
binaryName: string
|
|
22
|
-
): Promise<any> => {
|
|
23
|
-
const toolPath = join(getBinaryDirectory(), binaryName);
|
|
24
|
-
const toolFlags = args.flags ? splitFlagAndValue(createFlagsForTool(args.flags)) : [];
|
|
25
|
-
const combinedFlags = [...flagMapping, ...toolFlags];
|
|
26
|
-
|
|
27
|
-
return new Promise(
|
|
28
|
-
(resolve, reject): void => {
|
|
29
|
-
if (args.verbose) {
|
|
30
|
-
console.log(`Using flags: ${combinedFlags}`);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const child = spawn(toolPath, combinedFlags, {
|
|
34
|
-
// @ts-ignore
|
|
35
|
-
env: {
|
|
36
|
-
PATH: getBinaryDirectory() || process.env,
|
|
37
|
-
},
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
if (args.verbose) {
|
|
41
|
-
child.stdout.on('data', (data: string) => console.log(`${data}`));
|
|
42
|
-
|
|
43
|
-
child.stderr.on('data', (data: string) => {
|
|
44
|
-
console.log(`${data}`);
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
child.once('exit', (code: number) => {
|
|
49
|
-
if (code !== 0) {
|
|
50
|
-
reject(new Error(`Compression tool exited with error code ${code}`));
|
|
51
|
-
} else {
|
|
52
|
-
resolve();
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
);
|
|
57
|
-
};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
// Arguments
|
|
2
|
-
import { ICLIArgs } from '../argsHandler';
|
|
3
|
-
|
|
4
|
-
// Utilities
|
|
5
|
-
import { getFileExtension } from '../utilities';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Validate if the passed in images are accepted by the compression tool
|
|
9
|
-
*
|
|
10
|
-
* @param args Command line arguments
|
|
11
|
-
* @param inputTypes List of valid input types
|
|
12
|
-
* @param outputTypes List of valid output types
|
|
13
|
-
* @param compressionTypes List of valid compression types
|
|
14
|
-
* @param qualityTypes List of valid quality types
|
|
15
|
-
*/
|
|
16
|
-
export const validateArgs = (
|
|
17
|
-
args: ICLIArgs,
|
|
18
|
-
inputTypes: string[],
|
|
19
|
-
outputTypes: string[],
|
|
20
|
-
compressionTypes: string[],
|
|
21
|
-
qualityTypes: string[]
|
|
22
|
-
): void => {
|
|
23
|
-
if (!args.input) {
|
|
24
|
-
throw new Error('Input path is required');
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
if (!args.output) {
|
|
28
|
-
throw new Error('Output path is required');
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const inputFileExtension = getFileExtension(args.input);
|
|
32
|
-
const outputFileExtension = getFileExtension(args.output);
|
|
33
|
-
|
|
34
|
-
if (!outputTypes.includes(outputFileExtension)) {
|
|
35
|
-
throw new Error(
|
|
36
|
-
`${outputFileExtension} is not supported. The supported filetypes are: [${outputTypes}]`
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
if (!inputTypes.includes(inputFileExtension)) {
|
|
41
|
-
throw new Error(
|
|
42
|
-
`${inputFileExtension} is not supported. The supported filetypes are: [${inputTypes}]`
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
if (!args.compression) {
|
|
47
|
-
throw new Error(`Supported compression options: ${compressionTypes}`);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
if (!args.quality) {
|
|
51
|
-
throw new Error(`Supported quality options: ${qualityTypes}`);
|
|
52
|
-
}
|
|
53
|
-
};
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* General constants
|
|
3
|
-
*/
|
|
4
|
-
export const COMPRESSION_FORMAT_FLAGS = ['astc', 'etc', 'pvrtc', 's3tc'];
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Compression tool: PVRTexTool (http://cdn.imgtec.com/sdk-documentation/PVRTexTool.User+Manual.pdf)
|
|
8
|
-
* Compression tool: ASTCenc (https://github.com/ARM-software/astc-encoder)
|
|
9
|
-
* WebGL extension: https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_astc/
|
|
10
|
-
*/
|
|
11
|
-
export const ASTC = 'astc';
|
|
12
|
-
export const IS_ASTC = process.argv.includes(ASTC);
|
|
13
|
-
export const ASTC_SUPPORTED_INPUT_TYPES = ['.jpeg', '.jpg', '.png', '.bmp', '.gif'];
|
|
14
|
-
export const ASTC_SUPPORTED_OUTPUT_TYPES = ['.ktx'];
|
|
15
|
-
export const ASTC_COMPRESSION_TYPES = [
|
|
16
|
-
'ASTC_4x4',
|
|
17
|
-
'ASTC_5x4',
|
|
18
|
-
'ASTC_5x5',
|
|
19
|
-
'ASTC_6x5',
|
|
20
|
-
'ASTC_6x6',
|
|
21
|
-
'ASTC_8x5',
|
|
22
|
-
'ASTC_8x6',
|
|
23
|
-
'ASTC_8x8',
|
|
24
|
-
'ASTC_10x5',
|
|
25
|
-
'ASTC_10x6',
|
|
26
|
-
'ASTC_10x8',
|
|
27
|
-
'ASTC_10x10',
|
|
28
|
-
'ASTC_12x10',
|
|
29
|
-
'ASTC_12x12',
|
|
30
|
-
'ASTC_3x3x3',
|
|
31
|
-
'ASTC_4x3x3',
|
|
32
|
-
'ASTC_4x4x3',
|
|
33
|
-
'ASTC_4x4x4',
|
|
34
|
-
'ASTC_5x4x4',
|
|
35
|
-
'ASTC_5x5x4',
|
|
36
|
-
'ASTC_5x5x5',
|
|
37
|
-
'ASTC_6x5x5',
|
|
38
|
-
'ASTC_6x6x5',
|
|
39
|
-
'ASTC_6x6x6',
|
|
40
|
-
];
|
|
41
|
-
export const ASTC_QUALITY_TYPES = [
|
|
42
|
-
'astcveryfast',
|
|
43
|
-
'astcfast',
|
|
44
|
-
'astcmedium',
|
|
45
|
-
'astcthorough',
|
|
46
|
-
'astcexhaustive',
|
|
47
|
-
];
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Compression tool: PVRTexTool (http://cdn.imgtec.com/sdk-documentation/PVRTexTool.User+Manual.pdf)
|
|
51
|
-
* WebGL extension: https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_etc/
|
|
52
|
-
*/
|
|
53
|
-
export const ETC = 'etc';
|
|
54
|
-
export const IS_ETC = process.argv.includes(ETC);
|
|
55
|
-
export const ETC_SUPPORTED_INPUT_TYPES = ['.jpeg', '.jpg', '.png', '.bmp'];
|
|
56
|
-
export const ETC_SUPPORTED_OUTPUT_TYPES = ['.ktx'];
|
|
57
|
-
export const ETC_COMPRESSION_TYPES = ['ETC1', 'ETC2_RGBA', 'ETC2_RGB'];
|
|
58
|
-
export const ETC_QUALITY_TYPES = ['etcfast', 'etcslow', 'etcfastperceptual', 'etcslowperceptual'];
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Compression tool: PVRTexTool (http://cdn.imgtec.com/sdk-documentation/PVRTexTool.User+Manual.pdf)
|
|
62
|
-
* WebGL extension: http://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_pvrtc/
|
|
63
|
-
*/
|
|
64
|
-
export const PVRTC = 'pvrtc';
|
|
65
|
-
export const IS_PVRTC = process.argv.includes(PVRTC);
|
|
66
|
-
export const PVRTC_SUPPORTED_INPUT_TYPES = ['.jpeg', '.jpg', '.png', '.bmp'];
|
|
67
|
-
export const PVRTC_SUPPORTED_OUTPUT_TYPES = ['.ktx'];
|
|
68
|
-
export const PVRTC_COMPRESSION_TYPES = ['PVRTC1_2', 'PVRTC1_4', 'PVRTC1_2_RGB', 'PVRTC1_4_RGB'];
|
|
69
|
-
export const PVRTC_QUALITY_TYPES = [
|
|
70
|
-
'pvrtcfastest',
|
|
71
|
-
'pvrtcfast',
|
|
72
|
-
'pvrtcnormal',
|
|
73
|
-
'pvrtchigh',
|
|
74
|
-
'pvrtcbest',
|
|
75
|
-
];
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Compression tool: Crunch (https://github.com/BinomialLLC/crunch/blob/235946f7a1cf8b9c97e8bf0e8062d5439a51dec7/crunch/crunch.cpp#L70-L181)
|
|
79
|
-
* WebGL extension: http://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_s3tc/
|
|
80
|
-
*/
|
|
81
|
-
export const S3TC = 's3tc';
|
|
82
|
-
export const IS_S3TC = process.argv.includes(S3TC);
|
|
83
|
-
export const S3TC_SUPPORTED_INPUT_TYPES = ['.jpeg', '.jpg', '.png', '.bmp', '.gif'];
|
|
84
|
-
export const S3TC_SUPPORTED_OUTPUT_TYPES = ['.ktx'];
|
|
85
|
-
export const S3TC_COMPRESSION_TYPES = ['DXT1', 'DXT1A', 'DXT3', 'DXT5'];
|
|
86
|
-
export const S3TC_QUALITY_TYPES = ['superfast', 'fast', 'normal', 'better', 'uber'];
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
// Arguments
|
|
2
|
-
import { ICLIArgs } from './argsHandler';
|
|
3
|
-
|
|
4
|
-
// Compressors
|
|
5
|
-
import { compressWithCrunch } from './compressors/compressWithCrunch';
|
|
6
|
-
import { compressWithPVRTexTool } from './compressors/compressWithPVRTexTool';
|
|
7
|
-
|
|
8
|
-
// Constants
|
|
9
|
-
import { COMPRESSION_FORMAT_FLAGS } from './constants';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Pack a texture into a GPU compressed texture format
|
|
13
|
-
*/
|
|
14
|
-
export const pack = (CLIArgs?: ICLIArgs): Promise<any> => {
|
|
15
|
-
let args: ICLIArgs;
|
|
16
|
-
|
|
17
|
-
if (!CLIArgs) {
|
|
18
|
-
args = require('./argsHandler').CLIArgs;
|
|
19
|
-
} else {
|
|
20
|
-
args = CLIArgs;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
if (!args.type) {
|
|
24
|
-
throw new Error(`Supported compression formats: ${COMPRESSION_FORMAT_FLAGS}`);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
switch (args.type) {
|
|
28
|
-
case 'astc':
|
|
29
|
-
case 'etc':
|
|
30
|
-
case 'pvrtc':
|
|
31
|
-
return compressWithPVRTexTool(args);
|
|
32
|
-
case 's3tc':
|
|
33
|
-
return compressWithCrunch(args);
|
|
34
|
-
default:
|
|
35
|
-
throw new Error(`Compression format: ${args.type} was not recognized`);
|
|
36
|
-
}
|
|
37
|
-
};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
// Native
|
|
2
|
-
import { platform } from 'os';
|
|
3
|
-
import { basename, join, parse } from 'path';
|
|
4
|
-
|
|
5
|
-
// Vendor
|
|
6
|
-
// @ts-ignore
|
|
7
|
-
import imageSize from 'image-size';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Get the /bin/ directory from the root of the project
|
|
11
|
-
*/
|
|
12
|
-
export const getBinaryDirectory = (): string => join(__dirname, '../../../bin/', platform());
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Get a file extension from a file path (without a file basename)
|
|
16
|
-
*
|
|
17
|
-
* @param filepath Input filepath
|
|
18
|
-
*/
|
|
19
|
-
export const getFileExtension = (filepath: string): string => parse(filepath).ext;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Get a file basename from a file path (without a file extension)
|
|
23
|
-
*
|
|
24
|
-
* @param filepath Input filepath
|
|
25
|
-
*/
|
|
26
|
-
export const getFileName = (filepath: string): string =>
|
|
27
|
-
basename(filepath, getFileExtension(filepath));
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Get image size
|
|
31
|
-
*
|
|
32
|
-
* @param filepath Path to image
|
|
33
|
-
*/
|
|
34
|
-
export const getImageSize = (filepath: string): { width: number; height: number } =>
|
|
35
|
-
imageSize(filepath);
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Get mip map levels based on initial value
|
|
39
|
-
*
|
|
40
|
-
* @param value Initial value
|
|
41
|
-
*/
|
|
42
|
-
export const getMipChainLevels = (value: number): number => Math.floor(Math.log2(value)) + 1;
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Create flags out of custom flags passed in through the --flag parameter
|
|
46
|
-
*
|
|
47
|
-
* @param flags Array of flags to pass to the tool
|
|
48
|
-
*/
|
|
49
|
-
export const createFlagsForTool = (flags: string[]): string[] => flags.map(flag => `-${flag}`);
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Split flag name and flag value passed in through the --flag parameter
|
|
53
|
-
*
|
|
54
|
-
* @param flags Array of flags to pass to the tool
|
|
55
|
-
*/
|
|
56
|
-
export const splitFlagAndValue = (flags: any[]): string[] =>
|
|
57
|
-
[].concat(...flags.map(flag => flag.split(' ')));
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "texture-compressor",
|
|
3
|
-
"version": "1.0.2",
|
|
4
|
-
"description": "CLI tool for texture compression using ASTC, ETC, PVRTC and S3TC in a KTX container.",
|
|
5
|
-
"main": "dist/cli/lib/index.js",
|
|
6
|
-
"types": "dist/types/lib/index.d.ts",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"start": "tsc -w",
|
|
9
|
-
"lint": "tslint --project tsconfig.json -t codeFrame 'src/**/*.ts' 'test/**/*.ts'",
|
|
10
|
-
"prebuild": "rimraf dist",
|
|
11
|
-
"build": "tsc"
|
|
12
|
-
},
|
|
13
|
-
"bin": {
|
|
14
|
-
"texture-compressor": "./bin/texture-compressor.js"
|
|
15
|
-
},
|
|
16
|
-
"author": "Tim van Scherpenzeel",
|
|
17
|
-
"license": "MIT",
|
|
18
|
-
"dependencies": {
|
|
19
|
-
"argparse": "^1.0.10",
|
|
20
|
-
"image-size": "^0.7.4"
|
|
21
|
-
},
|
|
22
|
-
"devDependencies": {
|
|
23
|
-
"@types/argparse": "^1.0.36",
|
|
24
|
-
"@types/node": "^12.0.2",
|
|
25
|
-
"prettier": "^1.17.1",
|
|
26
|
-
"rimraf": "^2.6.3",
|
|
27
|
-
"tslint": "^5.16.0",
|
|
28
|
-
"tslint-config-prettier": "^1.18.0",
|
|
29
|
-
"typescript": "^3.4.5"
|
|
30
|
-
},
|
|
31
|
-
"prettier": {
|
|
32
|
-
"semi": true,
|
|
33
|
-
"singleQuote": true,
|
|
34
|
-
"trailingComma": "es5",
|
|
35
|
-
"printWidth": 100
|
|
36
|
-
}
|
|
37
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"defaultSeverity": "error",
|
|
3
|
-
"extends": ["tslint:recommended", "tslint-config-prettier"],
|
|
4
|
-
"jsRules": {},
|
|
5
|
-
"rules": {
|
|
6
|
-
"no-bitwise": false,
|
|
7
|
-
"no-console": false,
|
|
8
|
-
"trailing-comma": true,
|
|
9
|
-
"typedef": [true, "call-signature", "property-declaration", "arrow-call-signature"]
|
|
10
|
-
},
|
|
11
|
-
"rulesDirectory": []
|
|
12
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|