(data: Uint8Array, width: number, height: number)
| 399 | } |
| 400 | |
| 401 | static bgra555(data: Uint8Array, width: number, height: number): Uint8Array { |
| 402 | const rgba = new Uint8Array(4 * width * height); |
| 403 | let offset = 0; |
| 404 | |
| 405 | for (let i = 0; i < data.length; i += 2) { |
| 406 | const color = ImageDecoder.readUInt16LE(data, i); |
| 407 | const [r, g, b] = ImageDecoder.decode555(color); |
| 408 | |
| 409 | rgba[offset++] = r; |
| 410 | rgba[offset++] = g; |
| 411 | rgba[offset++] = b; |
| 412 | rgba[offset++] = 0xff; |
| 413 | } |
| 414 | |
| 415 | return rgba; |
| 416 | } |
| 417 | |
| 418 | static bgra565(data: Uint8Array, width: number, height: number): Uint8Array { |
| 419 | const rgba = new Uint8Array(4 * width * height); |
no test coverage detected