diff --git a/.source.1499879393800.0.5760841517536723.html b/.source.1499879393800.0.5760841517536723.html new file mode 100644 index 0000000000..89380eee8b --- /dev/null +++ b/.source.1499879393800.0.5760841517536723.html @@ -0,0 +1,37567 @@ + \ No newline at end of file diff --git a/dist/image-sequencer.js b/dist/image-sequencer.js index dc47d1f7cd..92a4e574b3 100644 --- a/dist/image-sequencer.js +++ b/dist/image-sequencer.js @@ -34803,7 +34803,8 @@ ImageSequencer = function ImageSequencer(options) { var image, steps = [], modules = require('./Modules'), - images = {}; + images = {}, + inputlog = []; // if in browser, prompt for an image // if (options.imageSelect || options.inBrowser) addStep('image-select'); @@ -34816,6 +34817,8 @@ ImageSequencer = function ImageSequencer(options) { for(arg in arguments){args.push(copy(arguments[arg]));} json_q = formatInput.call(this_,args,"+"); + inputlog.push({method:"addSteps", json_q:copy(json_q)}); + for (i in json_q) for (j in json_q[i]) require("./AddStep")(this_,i,json_q[i][j].name,json_q[i][j].o); @@ -34837,7 +34840,9 @@ ImageSequencer = function ImageSequencer(options) { const this_ = (this.name == "ImageSequencer")?this:this.sequencer; args = (this.name == "ImageSequencer")?[]:[this.images]; for(arg in arguments) args.push(copy(arguments[arg])); + json_q = formatInput.call(this_,args,"-"); + inputlog.push({method:"removeSteps", json_q:copy(json_q)}); for (img in json_q) { indices = json_q[img].sort(function(a,b){return b-a}); @@ -34856,6 +34861,7 @@ ImageSequencer = function ImageSequencer(options) { for (arg in arguments) args.push(arguments[arg]); json_q = formatInput.call(this_,args,"^"); + inputlog.push({method:"insertSteps", json_q:copy(json_q)}); for (img in json_q) { var details = json_q[img]; @@ -34873,6 +34879,7 @@ ImageSequencer = function ImageSequencer(options) { const this_ = (this.name == "ImageSequencer")?this:this.sequencer; args = (this.name == "ImageSequencer")?[]:[this.images]; for (var arg in arguments) args.push(copy(arguments[arg])); + callback = function() {}; for (var arg in args) if(objTypeOf(args[arg]) == "Function") @@ -34890,6 +34897,7 @@ ImageSequencer = function ImageSequencer(options) { for (arg in arguments) args.push(copy(arguments[arg])); json_q = formatInput.call(this,args,"l"); + inputlog.push({method:"loadImages", json_q:copy(json_q)}); loadedimages = this.copy(json_q.loadedimages); for (i in json_q.images) @@ -34922,6 +34930,7 @@ ImageSequencer = function ImageSequencer(options) { insertSteps: insertSteps, replaceImage: replaceImage, run: run, + inputlog: inputlog, modules: modules, images: images, ui: options.ui, @@ -34936,10 +34945,10 @@ module.exports = ImageSequencer; },{"./AddStep":114,"./FormatInput":115,"./InsertStep":117,"./LoadImage":118,"./Modules":119,"./ReplaceImage":120,"./Run":121,"jquery":44}],117:[function(require,module,exports){ function InsertStep(ref, image, index, name, o) { - function insertStep(image, index, name, o) { + function insertStep(image, index, name, o_) { ref.log('\x1b[36m%s\x1b[0m','inserting step \"' + name + '\" to \"' + image + '\" at \"'+index+'\".'); - o = o || {}; + o = ref.copy(o_); o.id = ref.options.sequencerCounter++; //Gives a Unique ID to each step o.name = o.name || name; o.selector = o.selector || 'ismod-' + name; diff --git a/index.js b/index.js index 9e2cf4da78..23b0f83ea2 100644 --- a/index.js +++ b/index.js @@ -5,7 +5,7 @@ sequencer.loadImages({images:{red:'examples/red.jpg'},callback:function(){ sequencer.addSteps(['do-nothing-pix','ndvi-red','invert']); sequencer.removeSteps(1); sequencer.insertSteps({ - red: [{index: -1, name: 'do-nothing', o:{}}] + red: [{index: -1, name: 'do-nothing-pix', o:{}}] }); sequencer.run(); }}); diff --git a/src/ImageSequencer.js b/src/ImageSequencer.js index 525c22faa5..0f3ad29031 100644 --- a/src/ImageSequencer.js +++ b/src/ImageSequencer.js @@ -41,7 +41,8 @@ ImageSequencer = function ImageSequencer(options) { var image, steps = [], modules = require('./Modules'), - images = {}; + images = {}, + inputlog = []; // if in browser, prompt for an image // if (options.imageSelect || options.inBrowser) addStep('image-select'); @@ -54,6 +55,8 @@ ImageSequencer = function ImageSequencer(options) { for(arg in arguments){args.push(copy(arguments[arg]));} json_q = formatInput.call(this_,args,"+"); + inputlog.push({method:"addSteps", json_q:copy(json_q)}); + for (i in json_q) for (j in json_q[i]) require("./AddStep")(this_,i,json_q[i][j].name,json_q[i][j].o); @@ -75,7 +78,9 @@ ImageSequencer = function ImageSequencer(options) { const this_ = (this.name == "ImageSequencer")?this:this.sequencer; args = (this.name == "ImageSequencer")?[]:[this.images]; for(arg in arguments) args.push(copy(arguments[arg])); + json_q = formatInput.call(this_,args,"-"); + inputlog.push({method:"removeSteps", json_q:copy(json_q)}); for (img in json_q) { indices = json_q[img].sort(function(a,b){return b-a}); @@ -94,6 +99,7 @@ ImageSequencer = function ImageSequencer(options) { for (arg in arguments) args.push(arguments[arg]); json_q = formatInput.call(this_,args,"^"); + inputlog.push({method:"insertSteps", json_q:copy(json_q)}); for (img in json_q) { var details = json_q[img]; @@ -111,6 +117,7 @@ ImageSequencer = function ImageSequencer(options) { const this_ = (this.name == "ImageSequencer")?this:this.sequencer; args = (this.name == "ImageSequencer")?[]:[this.images]; for (var arg in arguments) args.push(copy(arguments[arg])); + callback = function() {}; for (var arg in args) if(objTypeOf(args[arg]) == "Function") @@ -128,6 +135,7 @@ ImageSequencer = function ImageSequencer(options) { for (arg in arguments) args.push(copy(arguments[arg])); json_q = formatInput.call(this,args,"l"); + inputlog.push({method:"loadImages", json_q:copy(json_q)}); loadedimages = this.copy(json_q.loadedimages); for (i in json_q.images) @@ -160,6 +168,7 @@ ImageSequencer = function ImageSequencer(options) { insertSteps: insertSteps, replaceImage: replaceImage, run: run, + inputlog: inputlog, modules: modules, images: images, ui: options.ui, diff --git a/src/InsertStep.js b/src/InsertStep.js index 5546f542eb..08a99c6754 100644 --- a/src/InsertStep.js +++ b/src/InsertStep.js @@ -1,9 +1,9 @@ function InsertStep(ref, image, index, name, o) { - function insertStep(image, index, name, o) { + function insertStep(image, index, name, o_) { ref.log('\x1b[36m%s\x1b[0m','inserting step \"' + name + '\" to \"' + image + '\" at \"'+index+'\".'); - o = o || {}; + o = ref.copy(o_); o.id = ref.options.sequencerCounter++; //Gives a Unique ID to each step o.name = o.name || name; o.selector = o.selector || 'ismod-' + name;