MCPcopy Create free account
hub / github.com/32comic/image2pixel-web / split

Method split

pixelizer.js:1282–1293  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1280 }
1281
1282 split() {
1283 if (this.pixels.length < 2) return null;
1284
1285 const channel = this.splitChannel;
1286 this.pixels.sort((a, b) => a[channel] - b[channel]);
1287
1288 const mid = Math.floor(this.pixels.length / 2);
1289 const box1 = new ColorBox(this.pixels.slice(0, mid), this.level + 1);
1290 const box2 = new ColorBox(this.pixels.slice(mid), this.level + 1);
1291
1292 return [box1, box2];
1293 }
1294}
1295
1296// 初始化

Callers 3

medianCutQuantizationMethod · 0.45
server.jsFile · 0.45
parseGplWithMetaFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected