(data: Uint8Array, width: number, height: number)
| 416 | } |
| 417 | |
| 418 | static bgra565(data: Uint8Array, width: number, height: number): Uint8Array { |
| 419 | const rgba = new Uint8Array(4 * width * height); |
| 420 | let offset = 0; |
| 421 | |
| 422 | for (let i = 0; i < data.length; i += 2) { |
| 423 | const color = ImageDecoder.readUInt16LE(data, i); |
| 424 | const [r, g, b] = ImageDecoder.decode565(color); |
| 425 | |
| 426 | rgba[offset++] = r; |
| 427 | rgba[offset++] = g; |
| 428 | rgba[offset++] = b; |
| 429 | rgba[offset++] = 0xff; |
| 430 | } |
| 431 | |
| 432 | return rgba; |
| 433 | } |
| 434 | |
| 435 | static bgra888(data: Uint8Array, width: number, height: number): Uint8Array { |
| 436 | const rgba = new Uint8Array(4 * width * height); |
no test coverage detected