MCPcopy Create free account
hub / github.com/Timic3/rw-parser / bgra888

Method bgra888

src/renderware/utils/ImageDecoder.ts:435–445  ·  view source on GitHub ↗
(data: Uint8Array, width: number, height: number)

Source from the content-addressed store, hash-verified

433 }
434
435 static bgra888(data: Uint8Array, width: number, height: number): Uint8Array {
436 const rgba = new Uint8Array(4 * width * height);
437 for (let i = 0; i < data.length; i += 4) {
438 rgba[i + 0] = data[i + 2];
439 rgba[i + 1] = data[i + 1];
440 rgba[i + 2] = data[i + 0];
441 rgba[i + 3] = 0xff;
442 }
443
444 return rgba;
445 }
446
447 static bgra8888(data: Uint8Array, width: number, height: number): Uint8Array {
448 const rgba = new Uint8Array(4 * width * height);

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected