mirror of
https://github.com/publiclab/image-sequencer.git
synced 2025-12-16 13:20:01 +01:00
Modified Modules Folder Structure
This commit is contained in:
36
src/modules/Invert/Module.js
Normal file
36
src/modules/Invert/Module.js
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Display only the green channel
|
||||
*/
|
||||
module.exports = function GreenChannel(options) {
|
||||
|
||||
options = options || {};
|
||||
options.title = "Invert Colors";
|
||||
options.description = "Inverts the colors of the image";
|
||||
var output;
|
||||
|
||||
//function setup() {} // optional
|
||||
|
||||
function draw(input,callback) {
|
||||
this_ = this;
|
||||
function changePixel(r, g, b, a) {
|
||||
return [255-r, 255-g, 255-b, a];
|
||||
}
|
||||
function output(image,datauri,mimetype){
|
||||
this_.output = {src:datauri,format:mimetype}
|
||||
}
|
||||
return require('../_nomodule/PixelManipulation.js')(input, {
|
||||
output: output,
|
||||
changePixel: changePixel,
|
||||
format: input.format,
|
||||
image: options.image,
|
||||
callback: callback
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
options: options,
|
||||
//setup: setup, // optional
|
||||
draw: draw,
|
||||
output: output
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user