MCPcopy Create free account
hub / github.com/sparkjsdev/spark / read

Method read

src/RgbaArray.ts:189–198  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

187
188 // Read back the RGBA8 values from the readback buffer.
189 async read(): Promise<Uint8Array> {
190 if (!this.readback) {
191 throw new Error("No readback");
192 }
193 if (!this.array || this.array.length < this.count * 4) {
194 this.array = new Uint8Array(this.capacity * 4);
195 }
196 const result = await this.readback.readback({ readback: this.array });
197 return result.subarray(0, this.count * 4);
198 }
199
200 async getArray(): Promise<Uint8Array> {
201 if (this.readback) {

Callers 1

getArrayMethod · 0.95

Calls 1

readbackMethod · 0.80

Tested by

no test coverage detected