"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Functional_1 = require("../../../../../Class/Functional");
const _ids_1 = require("../../../../_ids");
class TransferFromImageBitmap extends Functional_1.Functional {
    constructor(system) {
        super({
            i: ['canvas', 'bitmap', 'init'],
            o: [],
        }, {
            input: {
                canvas: {
                    ref: true,
                },
                bitmap: {
                    ref: true,
                },
            },
        }, system, _ids_1.ID_TRANSFER_FROM_IMAGE_BITMAP);
    }
    async f({ canvas, bitmap, init }, done, fail) {
        const imageBitmap = await bitmap.imageBitmap();
        try {
            await canvas.transferFromImageBitmap(imageBitmap);
        }
        catch (err) {
            fail(err.message.toLowerCase());
            return;
        }
        done();
    }
}
exports.default = TransferFromImageBitmap;
//# sourceMappingURL=index.js.map