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

Method analyzeVerticalScanlines

pixelizer.js:300–311  ·  view source on GitHub ↗
(data, width, height)

Source from the content-addressed store, hash-verified

298 }
299
300 analyzeVerticalScanlines(data, width, height) {
301 const sizes = [];
302 const sampleLines = Math.min(10, width);
303
304 for (let i = 0; i < sampleLines; i++) {
305 const x = Math.floor((width * i) / (sampleLines - 1));
306 const lineSizes = this.analyzeScanline(data, width, height, x, false);
307 sizes.push(...lineSizes);
308 }
309
310 return this.calculateSizeStatistics(sizes);
311 }
312
313 analyzeScanline(data, width, height, pos, isHorizontal) {
314 const segments = [];

Callers 1

detectPixelBlockSizeMethod · 0.95

Calls 2

analyzeScanlineMethod · 0.95

Tested by

no test coverage detected