Benchmarks (#781)

* benchmarks initial try

* added test to package.json

* Update benchmark.js

* Update benchmark.js

* Update benchmark.js

* Update benchmark.js

* bigger image

* change load-Image to browser only and fix benchmark

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

* run on same image

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>
This commit is contained in:
Varun Gupta
2019-02-16 21:25:23 +05:30
committed by GitHub
parent 75dc23fb55
commit 81b06d1b42
5 changed files with 90 additions and 38 deletions

View File

@@ -68340,7 +68340,7 @@ module.exports = function ImportImageModule(options, UI) {
options.imageUrl = options.url || defaults.url;
var output,
imgObj = new Image();
imgObj = new Image();
// we should get UI to return the image thumbnail so we can attach our own UI extensions
@@ -68351,31 +68351,36 @@ module.exports = function ImportImageModule(options, UI) {
}
// This function is caled everytime the step has to be redrawn
function draw(input,callback) {
function draw(input, callback) {
var step = this;
step.metadata = step.metadata || {};
// TODO: develop a standard API method for saving each input state,
// for reference in future steps (for blending, for example)
step.metadata.input = input;
if (!options.inBrowser) { // This module is only for browser
this.output = input;
callback();
} else {
step.metadata = step.metadata || {};
// TODO: develop a standard API method for saving each input state,
// for reference in future steps (for blending, for example)
step.metadata.input = input;
function onLoad() {
function onLoad() {
// This output is accessible to Image Sequencer
step.output = {
src: imgObj.src,
format: options.format
// This output is accessible to Image Sequencer
step.output = {
src: imgObj.src,
format: options.format
}
// Tell Image Sequencer that step has been drawn
callback();
}
// Tell Image Sequencer that step has been drawn
callback();
options.format = require('../../util/GetFormat')(options.imageUrl);
imgObj.onload = onLoad;
imgObj.src = options.imageUrl;
}
options.format = require('../../util/GetFormat')(options.imageUrl);
imgObj.onload = onLoad;
imgObj.src = options.imageUrl;
}
return {