@woosh/meep-engine 2.121.6 → 2.121.8
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/package.json +1 -1
- package/src/core/path/computeFileExtension.d.ts.map +1 -1
- package/src/core/path/computeFileExtension.js +3 -4
- package/src/core/path/computeFileName.d.ts +12 -0
- package/src/core/path/computeFileName.d.ts.map +1 -0
- package/src/core/path/computeFileName.js +24 -0
- package/src/engine/graphics/texture/sampler/sampler2d_to_f16.d.ts +8 -0
- package/src/engine/graphics/texture/sampler/sampler2d_to_f16.d.ts.map +1 -0
- package/src/engine/graphics/texture/sampler/sampler2d_to_f16.js +21 -0
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"computeFileExtension.d.ts","sourceRoot":"","sources":["../../../../src/core/path/computeFileExtension.js"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,2CAHW,MAAM,GACJ,SAAO,IAAI,
|
|
1
|
+
{"version":3,"file":"computeFileExtension.d.ts","sourceRoot":"","sources":["../../../../src/core/path/computeFileExtension.js"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,2CAHW,MAAM,GACJ,SAAO,IAAI,CAkBvB"}
|
|
@@ -11,13 +11,12 @@ export function computeFileExtension(path) {
|
|
|
11
11
|
throw new Error(`path must be a string, instead was '${type_of_path}'`);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
const pathBase = computePathBase(path);
|
|
14
|
+
const base = computePathBase(path);
|
|
16
15
|
|
|
17
|
-
const lastDotIndex =
|
|
16
|
+
const lastDotIndex = base.lastIndexOf('.');
|
|
18
17
|
|
|
19
18
|
if (lastDotIndex !== -1) {
|
|
20
|
-
return
|
|
19
|
+
return base.substring(lastDotIndex + 1);
|
|
21
20
|
} else {
|
|
22
21
|
//no extension
|
|
23
22
|
return null;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get name of a file from a given path
|
|
3
|
+
* @param {string} path
|
|
4
|
+
* @returns {string}
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* 'a/b/c.txt' -> 'c'
|
|
8
|
+
* 'hello.txt' -> 'hello'
|
|
9
|
+
* 'http://meep.com/index.html' -> 'index'
|
|
10
|
+
*/
|
|
11
|
+
export function computeFileName(path: string): string;
|
|
12
|
+
//# sourceMappingURL=computeFileName.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"computeFileName.d.ts","sourceRoot":"","sources":["../../../../src/core/path/computeFileName.js"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,sCARW,MAAM,GACJ,MAAM,CAkBlB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { computePathBase } from "./computePathBase.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Get name of a file from a given path
|
|
5
|
+
* @param {string} path
|
|
6
|
+
* @returns {string}
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* 'a/b/c.txt' -> 'c'
|
|
10
|
+
* 'hello.txt' -> 'hello'
|
|
11
|
+
* 'http://meep.com/index.html' -> 'index'
|
|
12
|
+
*/
|
|
13
|
+
export function computeFileName(path) {
|
|
14
|
+
const base = computePathBase(path);
|
|
15
|
+
|
|
16
|
+
const lastDotIndex = base.lastIndexOf('.');
|
|
17
|
+
|
|
18
|
+
if (lastDotIndex !== -1) {
|
|
19
|
+
return base.substring(0, lastDotIndex);
|
|
20
|
+
} else {
|
|
21
|
+
//no extension
|
|
22
|
+
return base;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sampler2d_to_f16.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/texture/sampler/sampler2d_to_f16.js"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,wCAHW,SAAS,GACP,SAAS,CAcrB;0BAnByB,gBAAgB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { to_half_float_uint16 } from "../../../../core/binary/to_half_float_uint16.js";
|
|
2
|
+
import { Sampler2D } from "./Sampler2D.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* @param {Sampler2D} input
|
|
7
|
+
* @returns {Sampler2D}
|
|
8
|
+
*/
|
|
9
|
+
export function sampler2d_to_f16(input) {
|
|
10
|
+
|
|
11
|
+
const data = input.data;
|
|
12
|
+
|
|
13
|
+
const dest = Sampler2D.uint16(input.itemSize, input.width, input.height);
|
|
14
|
+
|
|
15
|
+
const n = data.length;
|
|
16
|
+
for (let i = 0; i < n; i++) {
|
|
17
|
+
dest.data[i] = to_half_float_uint16(data[i]);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return dest;
|
|
21
|
+
}
|