add toCliString function fixes #140 (#312)

* add toCliString function fixes #140

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* update docs

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* add test

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>
This commit is contained in:
Varun Gupta
2018-08-04 20:08:41 +05:30
committed by Jeffrey Warren
parent 5ab018fb84
commit 5b4e904636
7 changed files with 106 additions and 71 deletions

View File

@@ -1,13 +1,13 @@
/*
* Display only one color channel
*/
module.exports = function Channel(options,UI) {
module.exports = function Channel(options, UI) {
options.channel = options.channel || "green";
var output;
function draw(input,callback,progressObj) {
function draw(input, callback, progressObj) {
progressObj.stop(true);
progressObj.overrideFlag = true;
@@ -15,15 +15,15 @@ module.exports = function Channel(options,UI) {
var step = this;
function changePixel(r, g, b, a) {
if (options.channel == "red") return [r, 0, 0, a];
if (options.channel == "red") return [r, 0, 0, a];
if (options.channel == "green") return [0, g, 0, a];
if (options.channel == "blue") return [0, 0, b, a];
if (options.channel == "blue") return [0, 0, b, a];
}
function output(image,datauri,mimetype){
function output(image, datauri, mimetype) {
// This output is accesible by Image Sequencer
step.output = {src:datauri,format:mimetype};
step.output = { src: datauri, format: mimetype };
}
@@ -41,7 +41,7 @@ module.exports = function Channel(options,UI) {
return {
options: options,
//setup: setup, // optional
draw: draw,
draw: draw,
output: output,
UI: UI
}