mirror of
https://github.com/publiclab/image-sequencer.git
synced 2025-12-11 19:00:00 +01:00
* meta-modules in node Signed-off-by: tech4GT <varun.gupta1798@gmail.com> * meta-modules in browser Signed-off-by: tech4GT <varun.gupta1798@gmail.com> * update docs Signed-off-by: tech4GT <varun.gupta1798@gmail.com> * more doc Signed-off-by: tech4GT <varun.gupta1798@gmail.com> * fix typo Signed-off-by: tech4GT <varun.gupta1798@gmail.com> * update docs and sample meta-module Signed-off-by: tech4GT <varun.gupta1798@gmail.com> * add dynamic modules CLI from npm Signed-off-by: tech4GT <varun.gupta1798@gmail.com> * update Signed-off-by: tech4GT <varun.gupta1798@gmail.com> * meta-modules and sequence saving completed Signed-off-by: tech4GT <varun.gupta1798@gmail.com> * add docs Signed-off-by: tech4GT <varun.gupta1798@gmail.com> * update docs Signed-off-by: tech4GT <varun.gupta1798@gmail.com> * fixed test Signed-off-by: tech4GT <varun.gupta1798@gmail.com>
49 lines
1.1 KiB
JavaScript
Executable File
49 lines
1.1 KiB
JavaScript
Executable File
/*
|
|
* Blur an Image
|
|
*/
|
|
module.exports = function Blur(options, UI) {
|
|
|
|
options.blur = options.blur || 2
|
|
var output;
|
|
|
|
function draw(input, callback, progressObj) {
|
|
|
|
progressObj.stop(true);
|
|
progressObj.overrideFlag = true;
|
|
|
|
var step = this;
|
|
|
|
function changePixel(r, g, b, a) {
|
|
return [r, g, b, a]
|
|
}
|
|
|
|
function extraManipulation(pixels) {
|
|
pixels = require('./Blur')(pixels, options.blur)
|
|
return pixels
|
|
}
|
|
|
|
function output(image, datauri, mimetype) {
|
|
|
|
// This output is accessible by Image Sequencer
|
|
step.output = { src: datauri, format: mimetype };
|
|
|
|
}
|
|
|
|
return require('../_nomodule/PixelManipulation.js')(input, {
|
|
output: output,
|
|
changePixel: changePixel,
|
|
extraManipulation: extraManipulation,
|
|
format: input.format,
|
|
image: options.image,
|
|
callback: callback
|
|
});
|
|
|
|
}
|
|
return {
|
|
options: options,
|
|
draw: draw,
|
|
output: output,
|
|
UI: UI
|
|
}
|
|
}
|