From c5fb01edaacbc3128d24037a6bcaeec4812b2ffb Mon Sep 17 00:00:00 2001 From: Andrey Sidorov Date: Mon, 26 Oct 2015 10:09:01 +1100 Subject: [PATCH] added PictOp constant codes --- lib/ext/render.js | 75 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/lib/ext/render.js b/lib/ext/render.js index bbfc525..eebe912 100644 --- a/lib/ext/render.js +++ b/lib/ext/render.js @@ -198,7 +198,7 @@ exports.requireExt = function(display, callback) if (filterParams.length != 0) { throw 'Render.SetPictureFilter: "' + name + '" - unexpected parameters for filters'; } - } else if (name == 'convolution' || ) { + } else if (name == 'convolution') { if (filterParams.length < 2 || filterParams[0]*filterParams[1] !== filterParams.length + 2) { throw 'Render.SetPictureFilter: "convolution" - incorrect matrix dimensions. Must be flat array [ w, h, elem1, elem2, ... ]'; } @@ -600,5 +600,78 @@ exports.requireExt = function(display, callback) }; }); + ext.PictOp = { + Minimum: 0, + Clear: 0, + Src: 1, + Dst: 2, + Over: 3, + OverReverse: 4, + In: 5, + InReverse: 6, + Out: 7, + OutReverse: 8, + Atop: 9, + AtopReverse: 10, + Xor: 11, + Add: 12, + Saturate: 13, + Maximum: 13, + + /*, + * Operators only available in version 0.2, + */ + DisjointMinimum: 0x10, + DisjointClear: 0x10, + DisjointSrc: 0x11, + DisjointDst: 0x12, + DisjointOver: 0x13, + DisjointOverReverse: 0x14, + DisjointIn: 0x15, + DisjointInReverse: 0x16, + DisjointOut: 0x17, + DisjointOutReverse: 0x18, + DisjointAtop: 0x19, + DisjointAtopReverse: 0x1a, + DisjointXor: 0x1b, + DisjointMaximum: 0x1b, + + ConjointMinimum: 0x20, + ConjointClear: 0x20, + ConjointSrc: 0x21, + ConjointDst: 0x22, + ConjointOver: 0x23, + ConjointOverReverse: 0x24, + ConjointIn: 0x25, + ConjointInReverse: 0x26, + ConjointOut: 0x27, + ConjointOutReverse: 0x28, + ConjointAtop: 0x29, + ConjointAtopReverse: 0x2a, + ConjointXor: 0x2b, + ConjointMaximum: 0x2b, + + /*, + * Operators only available in version 0.11, + */ + BlendMinimum: 0x30, + Multiply: 0x30, + Screen: 0x31, + Overlay: 0x32, + Darken: 0x33, + Lighten: 0x34, + ColorDodge: 0x35, + ColorBurn: 0x36, + HardLight: 0x37, + SoftLight: 0x38, + Difference: 0x39, + Exclusion: 0x3a, + HSLHue: 0x3b, + HSLSaturation: 0x3c, + HSLColor: 0x3d, + HSLLuminosity: 0x3e, + BlendMaximum: 0x3e + }; + }); }