Implemented UI Methods

This commit is contained in:
Chinmay Pandhare
2017-07-22 02:01:03 +05:30
parent 557a1166b3
commit 555e37190b
14 changed files with 356 additions and 172 deletions

View File

@@ -1,22 +1,27 @@
/*
* Display only the green channel
*/
module.exports = function GreenChannel(options) {
module.exports = function GreenChannel(options,UI) {
options = options || {};
options.title = "Invert Colors";
options.description = "Inverts the colors of the image";
UI.setup();
var output;
//function setup() {} // optional
function draw(input,callback) {
UI.drawing();
var this_ = this;
function changePixel(r, g, b, a) {
return [255-r, 255-g, 255-b, a];
}
function output(image,datauri,mimetype){
this_.output = {src:datauri,format:mimetype}
this_.output = {src:datauri,format:mimetype};
UI.drawn(datauri);
}
return require('../_nomodule/PixelManipulation.js')(input, {
output: output,
@@ -25,12 +30,14 @@ module.exports = function GreenChannel(options) {
image: options.image,
callback: callback
});
}
return {
options: options,
//setup: setup, // optional
draw: draw,
output: output
output: output,
UI: UI
}
}