Build an rgb48le buffer with a single solid color (16-bit per channel)
( width: number, height: number, r16: number, g16: number, b16: number, )
| 452 | |
| 453 | /** Build an rgb48le buffer with a single solid color (16-bit per channel) */ |
| 454 | function makeHdrFrame( |
| 455 | width: number, |
| 456 | height: number, |
| 457 | r16: number, |
| 458 | g16: number, |
| 459 | b16: number, |
| 460 | ): Buffer { |
| 461 | const buf = Buffer.allocUnsafe(width * height * 6); |
| 462 | for (let i = 0; i < width * height; i++) { |
| 463 | buf.writeUInt16LE(r16, i * 6); |
| 464 | buf.writeUInt16LE(g16, i * 6 + 2); |
| 465 | buf.writeUInt16LE(b16, i * 6 + 4); |
| 466 | } |
| 467 | return buf; |
| 468 | } |
| 469 | |
| 470 | /** Build a raw RGBA array (Uint8Array) with a single solid color */ |
| 471 | function makeDomRgba( |