MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / makeHdrFrame

Function makeHdrFrame

packages/engine/src/utils/alphaBlit.test.ts:454–468  ·  view source on GitHub ↗

Build an rgb48le buffer with a single solid color (16-bit per channel)

(
  width: number,
  height: number,
  r16: number,
  g16: number,
  b16: number,
)

Source from the content-addressed store, hash-verified

452
453/** Build an rgb48le buffer with a single solid color (16-bit per channel) */
454function 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 */
471function makeDomRgba(

Callers 1

alphaBlit.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected