LarpixClient/node_modules/gifuct-js/lib/deinterlace.js
olcxja 95aaaa69ea
All checks were successful
Android Build / publish (push) Successful in 57s
Linux Build / publish (push) Successful in 53s
big updat:
- update dependencies
- add webp support and webp conversion for profile images
2026-07-02 22:40:46 +02:00

35 lines
No EOL
858 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.deinterlace = void 0;
/**
* Deinterlace function from https://github.com/shachaf/jsgif
*/
var deinterlace = function deinterlace(pixels, width) {
var newPixels = new Array(pixels.length);
var rows = pixels.length / width;
var cpRow = function cpRow(toRow, fromRow) {
var fromPixels = pixels.slice(fromRow * width, (fromRow + 1) * width);
newPixels.splice.apply(newPixels, [toRow * width, width].concat(fromPixels));
}; // See appendix E.
var offsets = [0, 4, 2, 1];
var steps = [8, 8, 4, 2];
var fromRow = 0;
for (var pass = 0; pass < 4; pass++) {
for (var toRow = offsets[pass]; toRow < rows; toRow += steps[pass]) {
cpRow(toRow, fromRow);
fromRow++;
}
}
return newPixels;
};
exports.deinterlace = deinterlace;