mirror of
https://github.com/tvytlx/ai-agent-deep-dive.git
synced 2026-04-05 08:34:47 +08:00
Add extracted source directory and README navigation
This commit is contained in:
16
extracted-source/node_modules/pngjs/lib/paeth-predictor.js
generated
vendored
Normal file
16
extracted-source/node_modules/pngjs/lib/paeth-predictor.js
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = function paethPredictor(left, above, upLeft) {
|
||||
let paeth = left + above - upLeft;
|
||||
let pLeft = Math.abs(paeth - left);
|
||||
let pAbove = Math.abs(paeth - above);
|
||||
let pUpLeft = Math.abs(paeth - upLeft);
|
||||
|
||||
if (pLeft <= pAbove && pLeft <= pUpLeft) {
|
||||
return left;
|
||||
}
|
||||
if (pAbove <= pUpLeft) {
|
||||
return above;
|
||||
}
|
||||
return upLeft;
|
||||
};
|
||||
Reference in New Issue
Block a user