pixel value on hover in ndvi fixes #307 (#314)

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

View File

@@ -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
}
}