MCPcopy Create free account
hub / github.com/SkyeShark/SeedThree / colDiff

Function colDiff

scripts/texture/check-tile.mjs:36–41  ·  view source on GitHub ↗
(x0, x1)

Source from the content-addressed store, hash-verified

34
35// Mean absolute difference (over RGB) between two columns.
36function colDiff(x0, x1) {
37 let sum = 0;
38 for (let y = 0; y < H; y++)
39 for (let c = 0; c < 3; c++) sum += Math.abs(at(x0, y, c) - at(x1, y, c));
40 return sum / (H * 3);
41}
42function rowDiff(y0, y1) {
43 let sum = 0;
44 for (let x = 0; x < W; x++)

Callers 1

check-tile.mjsFile · 0.85

Calls 1

atFunction · 0.85

Tested by

no test coverage detected