@elgato-stream-deck/core
Version:
An npm module for interfacing with the Elgato Stream Deck
18 lines • 794 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.JpegButtonLcdImagePacker = void 0;
const util_js_1 = require("../../util.js");
class JpegButtonLcdImagePacker {
#encodeJPEG;
#xyFlip;
constructor(encodeJPEG, xyFlip) {
this.#encodeJPEG = encodeJPEG;
this.#xyFlip = xyFlip;
}
async convertPixelBuffer(sourceBuffer, sourceOptions, targetSize) {
const byteBuffer = (0, util_js_1.transformImageBuffer)(sourceBuffer, sourceOptions, { colorMode: 'rgba', xFlip: this.#xyFlip, yFlip: this.#xyFlip }, 0, targetSize.width, targetSize.height);
return this.#encodeJPEG(byteBuffer, targetSize.width, targetSize.height);
}
}
exports.JpegButtonLcdImagePacker = JpegButtonLcdImagePacker;
//# sourceMappingURL=jpeg.js.map