mirror of
https://github.com/publiclab/image-sequencer.git
synced 2025-12-14 04:10:04 +01:00
40 lines
799 B
JavaScript
40 lines
799 B
JavaScript
/*
|
|
* This module extracts pixels and saves them as it is.
|
|
*/
|
|
module.exports = function DoNothingPix(options,UI) {
|
|
|
|
options = options || {};
|
|
options.title = "Do Nothing with pixels";
|
|
UI.onSetup();
|
|
var output;
|
|
|
|
function draw(input,callback) {
|
|
|
|
UI.onDraw();
|
|
const step = this;
|
|
|
|
function changePixel(r, g, b, a) {
|
|
return [r, g, b, a];
|
|
}
|
|
function output(image,datauri,mimetype){
|
|
step.output = {src:datauri,format:mimetype}
|
|
UI.onComplete(datauri);
|
|
}
|
|
return require('../_nomodule/PixelManipulation.js')(input, {
|
|
output: output,
|
|
changePixel: changePixel,
|
|
format: input.format,
|
|
image: options.image,
|
|
callback: callback
|
|
});
|
|
|
|
}
|
|
|
|
return {
|
|
options: options,
|
|
draw: draw,
|
|
output: output,
|
|
UI: UI
|
|
}
|
|
}
|