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

Function paethRef

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

Source from the content-addressed store, hash-verified

167// filter type so the defilter logic gets actual coverage.
168
169const paethRef = (a: number, b: number, c: number): number => {
170 const p = a + b - c;
171 const pa = Math.abs(p - a);
172 const pb = Math.abs(p - b);
173 const pc = Math.abs(p - c);
174 if (pa <= pb && pa <= pc) return a;
175 if (pb <= pc) return b;
176 return c;
177};
178
179/**
180 * Build a PNG with a specific filter type applied to every row. Encodes a

Callers 1

makePngWithFilterFunction · 0.85

Calls 1

absMethod · 0.80

Tested by

no test coverage detected