mirror of
https://github.com/publiclab/image-sequencer.git
synced 2025-12-14 04:10:04 +01:00
Fix : add a step in the demo
This commit is contained in:
170479
dist/image-sequencer.js
vendored
170479
dist/image-sequencer.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,7 +1,7 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
|
|
||||||
<title>Image Sequencer</title>
|
<title>Image Sequencer</title>
|
||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
<option value="green-channel">Green channel</option>
|
<option value="green-channel">Green channel</option>
|
||||||
<option value="plot">Plot with colorbar</option>
|
<option value="plot">Plot with colorbar</option>
|
||||||
<option value="image-threshold">Threshold image</option>
|
<option value="image-threshold">Threshold image</option>
|
||||||
</select>
|
</select>
|
||||||
<p><button class="btn btn-default add-step">Add step</button></p>
|
<p><button class="btn btn-default add-step">Add step</button></p>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
@@ -72,10 +72,9 @@
|
|||||||
//sequencer.addStep('plot');
|
//sequencer.addStep('plot');
|
||||||
|
|
||||||
$('.add-step').click(function(e) {
|
$('.add-step').click(function(e) {
|
||||||
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
sequencer.addStep($('.select-module').val());
|
sequencer.addStep($('.select-module').val());
|
||||||
sequencer.run(); // later we might only run this step, if we can fetch the image output from the previous
|
sequencer.run(document.image); // later we might only run this step, if we can fetch the image output from the previous
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ ImageSequencer = function ImageSequencer(options) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pre-set the initial output behavior of the final step,
|
// Pre-set the initial output behavior of the final step,
|
||||||
// which will be changed if an additional step is added.
|
// which will be changed if an additional step is added.
|
||||||
module.options.output = function output(image) {
|
module.options.output = function output(image) {
|
||||||
if (module.options.ui && module.options.ui.display) module.options.ui.display(image);
|
if (module.options.ui && module.options.ui.display) module.options.ui.display(image);
|
||||||
@@ -68,7 +68,7 @@ ImageSequencer = function ImageSequencer(options) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// passed image is optional but you can pass a
|
// passed image is optional but you can pass a
|
||||||
// non-stored image through the whole steps chain
|
// non-stored image through the whole steps chain
|
||||||
function run(image) {
|
function run(image) {
|
||||||
if (image) steps[1].draw(image);
|
if (image) steps[1].draw(image);
|
||||||
@@ -89,6 +89,7 @@ ImageSequencer = function ImageSequencer(options) {
|
|||||||
image.onload = function() {
|
image.onload = function() {
|
||||||
run(image);
|
run(image);
|
||||||
if (callback) callback(image);
|
if (callback) callback(image);
|
||||||
|
document.image = image;
|
||||||
}
|
}
|
||||||
image.src = src;
|
image.src = src;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ module.exports = function ImageSelect(options) {
|
|||||||
|
|
||||||
image = new Image();
|
image = new Image();
|
||||||
image.src = event.target.result;
|
image.src = event.target.result;
|
||||||
|
document.image = image;
|
||||||
el.html(image); // may be redundant
|
el.html(image); // may be redundant
|
||||||
|
|
||||||
// this is done once per image:
|
// this is done once per image:
|
||||||
|
|||||||
Reference in New Issue
Block a user