mirror of
https://github.com/publiclab/image-sequencer.git
synced 2025-12-11 19:00:00 +01:00
42 lines
958 B
JavaScript
42 lines
958 B
JavaScript
|
|
module.exports = function TextOverlay(options, UI) {
|
|
|
|
var output;
|
|
|
|
function draw(input, callback) {
|
|
|
|
var step = this;
|
|
|
|
var priorStep = this.getStep(-1); // get the previous step to add text onto it.
|
|
|
|
function extraManipulation(pixels) {
|
|
//if (options.step.inBrowser)
|
|
pixels = require('./TextOverlay')(pixels, options, priorStep);
|
|
return pixels;
|
|
}
|
|
|
|
function output(image, datauri, mimetype, wasmSuccess) {
|
|
step.output = { src: datauri, format: mimetype, wasmSuccess, useWasm: options.useWasm };
|
|
}
|
|
|
|
return require('../_nomodule/PixelManipulation.js')(input, {
|
|
output: output,
|
|
ui: options.step.ui,
|
|
extraManipulation: extraManipulation,
|
|
format: input.format,
|
|
image: options.image,
|
|
inBrowser: options.inBrowser,
|
|
callback: callback,
|
|
useWasm:options.useWasm
|
|
});
|
|
|
|
}
|
|
|
|
return {
|
|
options: options,
|
|
draw: draw,
|
|
output: output,
|
|
UI: UI
|
|
};
|
|
};
|