MCPcopy Index your code
hub / github.com/gpujs/gpu.js / toArray

Method toArray

src/input.js:34–44  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

32 }
33
34 toArray() {
35 const { utils } = require('./utils');
36 const [w, h, d] = this.size;
37 if (d) {
38 return utils.erectMemoryOptimized3DFloat(this.value.subarray ? this.value : new Float32Array(this.value), w, h, d);
39 } else if (h) {
40 return utils.erectMemoryOptimized2DFloat(this.value.subarray ? this.value : new Float32Array(this.value), w, h);
41 } else {
42 return this.value;
43 }
44 }
45}
46
47function input(value, size) {

Calls

no outgoing calls

Tested by

no test coverage detected