@woosh/meep-engine 2.121.7 → 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
CHANGED
|
@@ -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
|
+
}
|