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