mirror of
https://github.com/publiclab/image-sequencer.git
synced 2025-12-17 13:50:04 +01:00
Add comments; Remove do-nothing, do-nothing-pix
This commit is contained in:
@@ -6,24 +6,35 @@ module.exports = function GreenChannel(options,UI) {
|
||||
options = options || {};
|
||||
options.title = "Invert Colors";
|
||||
options.description = "Inverts the colors of the image";
|
||||
|
||||
// Tell UI that a step has been set up.
|
||||
UI.onSetup(options.step);
|
||||
var output;
|
||||
|
||||
//function setup() {} // optional
|
||||
|
||||
// The function which is called on every draw.
|
||||
function draw(input,callback) {
|
||||
|
||||
// Tell UI that a step is being drawn.
|
||||
UI.onDraw(options.step);
|
||||
|
||||
const step = this;
|
||||
|
||||
function changePixel(r, g, b, a) {
|
||||
return [255-r, 255-g, 255-b, a];
|
||||
}
|
||||
|
||||
function output(image,datauri,mimetype){
|
||||
|
||||
// This output is accessible by Image Sequencer
|
||||
step.output = {src:datauri,format:mimetype};
|
||||
|
||||
// This output is accessible by UI
|
||||
options.step.output = datauri;
|
||||
|
||||
// Tell UI that step has been drawn.
|
||||
UI.onComplete(options.step);
|
||||
}
|
||||
|
||||
return require('../_nomodule/PixelManipulation.js')(input, {
|
||||
output: output,
|
||||
changePixel: changePixel,
|
||||
@@ -36,7 +47,6 @@ module.exports = function GreenChannel(options,UI) {
|
||||
|
||||
return {
|
||||
options: options,
|
||||
//setup: setup, // optional
|
||||
draw: draw,
|
||||
output: output,
|
||||
UI: UI
|
||||
|
||||
Reference in New Issue
Block a user