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

Method analyzeHorizontalScanlines

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

Source from the content-addressed store, hash-verified

285 }
286
287 analyzeHorizontalScanlines(data, width, height) {
288 const sizes = [];
289 const sampleLines = Math.min(10, height);
290
291 for (let i = 0; i < sampleLines; i++) {
292 const y = Math.floor((height * i) / (sampleLines - 1));
293 const lineSizes = this.analyzeScanline(data, width, height, y, true);
294 sizes.push(...lineSizes);
295 }
296
297 return this.calculateSizeStatistics(sizes);
298 }
299
300 analyzeVerticalScanlines(data, width, height) {
301 const sizes = [];

Callers 1

detectPixelBlockSizeMethod · 0.95

Calls 2

analyzeScanlineMethod · 0.95

Tested by

no test coverage detected