mirror of
https://github.com/publiclab/image-sequencer.git
synced 2025-12-05 16:00:01 +01:00
* Add wasm code * First working model * Add PixelManipulation web assembly code to browser and node * Tests corrected for modules * Corrected test script * Add wasm bechmarks * Update Readme * Applies toggling functionality and refactored PixelManipulation code * Added documentation and corrected wasm toggling * change noise reduction module to use wasm code * Corrected formatting and removed extra comments * Add default wasm option and made README changes * Fixed negative test timings * combined benchmarks file * Update benchmark.js * Removed copies of wasm file and corrected test format * Update package.json Co-Authored-By: Jeffrey Warren <jeff@unterbahn.com> * Added wasm file and removed redundant code * Removed earlier benchmarks * move test/core/sequencer/benchmark.js to its own test command, not passing to tape-spec * Solves memory leaks and blank lines * Solves memory leaks and blank lines * Added handler for node code * Modify test script * Modify test script * Correct doc and removed pace fuctionality
43 lines
906 B
JavaScript
43 lines
906 B
JavaScript
module.exports = function PaintBucket(options, UI) {
|
|
|
|
var output;
|
|
|
|
function draw(input, callback, progressObj) {
|
|
|
|
progressObj.stop(true);
|
|
progressObj.overrideFlag = true;
|
|
|
|
var step = this;
|
|
|
|
function extraManipulation(pixels) {
|
|
|
|
pixels = require('./PaintBucket')(pixels, options);
|
|
return pixels;
|
|
|
|
}
|
|
|
|
function output(image, datauri, mimetype) {
|
|
// This output is accesible by Image Sequencer
|
|
step.output = { src: datauri, format: mimetype };
|
|
}
|
|
|
|
return require('../_nomodule/PixelManipulation.js')(input, {
|
|
output: output,
|
|
ui: options.step.ui,
|
|
extraManipulation: extraManipulation,
|
|
format: input.format,
|
|
image: options.image,
|
|
inBrowser: options.inBrowser,
|
|
callback: callback,
|
|
useWasm:options.useWasm
|
|
});
|
|
}
|
|
|
|
return {
|
|
options: options,
|
|
draw: draw,
|
|
output: output,
|
|
UI: UI
|
|
};
|
|
};
|