mirror of
https://github.com/publiclab/image-sequencer.git
synced 2025-12-13 20:00:05 +01:00
Signed-off-by: tech4GT <varun.gupta1798@gmail.com>
This commit is contained in:
committed by
Jeffrey Warren
parent
5b4e904636
commit
6be996692a
@@ -1,14 +1,16 @@
|
||||
/*
|
||||
* NDVI with red filter (blue channel is infrared)
|
||||
*/
|
||||
module.exports = function Ndvi(options,UI) {
|
||||
module.exports = function Ndvi(options, UI) {
|
||||
|
||||
if (options.step.inBrowser) var ui = require('./Ui.js')(options.step, UI);
|
||||
|
||||
options.filter = options.filter || "red";
|
||||
|
||||
var output;
|
||||
|
||||
// The function which is called on every draw.
|
||||
function draw(input,callback,progressObj) {
|
||||
function draw(input, callback, progressObj) {
|
||||
|
||||
progressObj.stop(true);
|
||||
progressObj.overrideFlag = true;
|
||||
@@ -22,20 +24,27 @@ module.exports = function Ndvi(options,UI) {
|
||||
return [x, x, x, a];
|
||||
}
|
||||
|
||||
function output(image,datauri,mimetype){
|
||||
function output(image, datauri, mimetype) {
|
||||
|
||||
// This output is accessible by Image Sequencer
|
||||
step.output = {src:datauri,format:mimetype};
|
||||
step.output = { src: datauri, format: mimetype };
|
||||
|
||||
}
|
||||
|
||||
function modifiedCallback() {
|
||||
if (options.step.inBrowser) {
|
||||
ui.setup();
|
||||
}
|
||||
callback();
|
||||
}
|
||||
|
||||
return require('../_nomodule/PixelManipulation.js')(input, {
|
||||
output: output,
|
||||
changePixel: changePixel,
|
||||
format: input.format,
|
||||
image: options.image,
|
||||
inBrowser: options.inBrowser,
|
||||
callback: callback
|
||||
callback: modifiedCallback
|
||||
});
|
||||
|
||||
}
|
||||
@@ -44,6 +53,6 @@ module.exports = function Ndvi(options,UI) {
|
||||
options: options,
|
||||
draw: draw,
|
||||
output: output,
|
||||
UI:UI
|
||||
UI: UI
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user