Grid-Overlay module. (#974)

* Grid-Overlay module

* Added the X and Y for inputs
This commit is contained in:
Harshith pabbati
2019-04-03 18:16:57 +05:30
committed by Jeffrey Warren
parent 1de170c978
commit 0e7323efa9
5 changed files with 119 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
module.exports = function GridOverlay(options,UI) {
var output;
function draw(input, callback, progressObj) {
progressObj.stop(true);
progressObj.overrideFlag = true;
var step = this;
if (!options.step.inBrowser) { // This module is only for browser
this.output = input;
callback();
}
else{
var priorStep = this.getStep(-1); // get the previous step to add text onto it.
function extraManipulation(pixels) {
//if (options.step.inBrowser)
pixels = require('./GridOverlay')(pixels, options,priorStep);
return pixels
}
function output(image, datauri, mimetype) {
// This output is accesible by Image Sequencer
step.output = { src: datauri, format: mimetype };
}
return require('../_nomodule/PixelManipulation.js')(input, {
output: output,
extraManipulation: extraManipulation,
format: input.format,
image: options.image,
inBrowser: options.inBrowser,
callback: callback
});
}
}
return {
options: options,
draw: draw,
output: output,
UI: UI
}
}