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

Function paeth

packages/engine/src/utils/alphaBlit.ts:12–20  ·  view source on GitHub ↗
(a: number, b: number, c: number)

Source from the content-addressed store, hash-verified

10// ── PNG decoder ───────────────────────────────────────────────────────────────
11
12function paeth(a: number, b: number, c: number): number {
13 const p = a + b - c;
14 const pa = Math.abs(p - a);
15 const pb = Math.abs(p - b);
16 const pc = Math.abs(p - c);
17 if (pa <= pb && pa <= pc) return a;
18 if (pb <= pc) return b;
19 return c;
20}
21
22/**
23 * Shared PNG chunk parsing + filter reconstruction.

Callers 1

decodePngRawFunction · 0.85

Calls 1

absMethod · 0.80

Tested by

no test coverage detected