(data: Uint8Array, width: number, height: number)
| 457 | } |
| 458 | |
| 459 | static lum8(data: Uint8Array, width: number, height: number): Uint8Array { |
| 460 | const rgba = new Uint8Array(4 * width * height); |
| 461 | |
| 462 | for (let i = 0; i < data.length; i++) { |
| 463 | const offset = i * 4; |
| 464 | const luminance = data[i]; |
| 465 | rgba[offset + 0] = luminance; // R |
| 466 | rgba[offset + 1] = luminance; // G |
| 467 | rgba[offset + 2] = luminance; // B |
| 468 | rgba[offset + 3] = 0xff; |
| 469 | } |
| 470 | |
| 471 | return rgba; |
| 472 | } |
| 473 | |
| 474 | static lum8a8(data: Uint8Array, width: number, height: number): Uint8Array { |
| 475 | const rgba = new Uint8Array(4 * width * height); |
no outgoing calls
no test coverage detected