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

Method bgra1555

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

Source from the content-addressed store, hash-verified

365 }
366
367 static bgra1555(data: Uint8Array, width: number, height: number): Uint8Array {
368 const rbga = new Uint8Array(4 * width * height);
369 let offset = 0;
370
371 for (let i = 0; i < data.length; i += 2) {
372 const color = ImageDecoder.readUInt16LE(data, i);
373 const [a, r, g, b] = ImageDecoder.decode1555(color);
374
375 rbga[offset++] = r;
376 rbga[offset++] = g;
377 rbga[offset++] = b;
378 rbga[offset++] = a;
379 }
380
381 return rbga;
382 }
383
384 static bgra4444(data: Uint8Array, width: number, height: number): Uint8Array {
385 const rgba = new Uint8Array(4 * width * height);

Callers 1

Calls 2

readUInt16LEMethod · 0.80
decode1555Method · 0.80

Tested by

no test coverage detected