UNPKG

@elgato-stream-deck/core

Version:

An npm module for interfacing with the Elgato Stream Deck

19 lines 919 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.BitmapButtonLcdImagePacker = void 0; const util_js_1 = require("../../util.js"); class BitmapButtonLcdImagePacker { #targetOptions; #bmpImagePPM; constructor(targetOptions, bmpImagePPM) { this.#targetOptions = targetOptions; this.#bmpImagePPM = bmpImagePPM; } async convertPixelBuffer(sourceBuffer, sourceOptions, targetSize) { const byteBuffer = (0, util_js_1.transformImageBuffer)(sourceBuffer, sourceOptions, this.#targetOptions, util_js_1.BMP_HEADER_LENGTH, targetSize.width, targetSize.height); (0, util_js_1.writeBMPHeader)(byteBuffer, targetSize.width, targetSize.height, byteBuffer.length - util_js_1.BMP_HEADER_LENGTH, this.#bmpImagePPM); return byteBuffer; } } exports.BitmapButtonLcdImagePacker = BitmapButtonLcdImagePacker; //# sourceMappingURL=bitmap.js.map