Files
image-sequencer/test/core/sequencer/dynamic-imports.js
Slytherin 30659d4656 Using wasm to accelerate PixelManipulation.js (#1093)
* 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
2019-06-21 10:54:56 -04:00

19 lines
1023 B
JavaScript

var test = require('tape');
require('../../../src/ImageSequencer.js');
var sequencer = ImageSequencer({ ui: false});
var red = 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAAQABADASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAf/xAAUEAEAAAAAAAAAAAAAAAAAAAAA/8QAFQEBAQAAAAAAAAAAAAAAAAAABgj/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwCdABykX//Z';
test('Dynamically add a test Module', function(t) {
sequencer.loadNewModule('test', { func: require('../testModule/Module'), info: require('../testModule/info') });
sequencer.loadImages(red);
t.deepEqual(sequencer.modules['test'], [
require('../testModule/Module'),
require('../testModule/info')
], 'test module was succesfully imported');
sequencer.addSteps('invert');
sequencer.addSteps('test');
sequencer.addSteps('invert');
sequencer.run();
t.end();
});