Skip to content

Commit c5dc1ee

Browse files
author
Lauren McCarthy
committed
adding support for filter name variables
1 parent 7e29681 commit c5dc1ee

File tree

4 files changed

+29
-4
lines changed

4 files changed

+29
-4
lines changed

lib/addons/p5.dom.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,13 @@
479479
throw 'getUserMedia not supported in this browser';
480480
}
481481
var c = addElement(elt, this, true);
482-
c.loadedmetadata = true;
482+
c.loadedmetadata = false;
483+
// set width and height onload metadata
484+
elt.addEventListener('loadedmetadata', function() {
485+
c.width = elt.videoWidth;
486+
c.height = elt.videoHeight;
487+
c.loadedmetadata = true;
488+
});
483489
return c;
484490
};
485491

lib/p5.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,14 @@ amdclean['constants'] = function (require) {
8787
SOFT_LIGHT: 'soft-light',
8888
DODGE: 'color-dodge',
8989
BURN: 'color-burn',
90+
THRESHOLD: 'threshold',
91+
GRAY: 'gray',
92+
OPAQUE: 'opaque',
93+
INVERT: 'invert',
94+
POSTERIZE: 'posterize',
95+
DILATE: 'dilate',
96+
ERODE: 'erode',
97+
BLUR: 'blur',
9098
NORMAL: 'normal',
9199
ITALIC: 'italic',
92100
BOLD: 'bold',

lib/p5.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/core/constants.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,17 @@ define(function(require) {
135135
DODGE: 'color-dodge',
136136
BURN: 'color-burn',
137137

138+
// FILTERS
139+
THRESHOLD: 'threshold',
140+
GRAY: 'gray',
141+
OPAQUE: 'opaque',
142+
INVERT: 'invert',
143+
POSTERIZE: 'posterize',
144+
DILATE: 'dilate',
145+
ERODE: 'erode',
146+
BLUR: 'blur',
147+
148+
138149
// TYPOGRAPHY
139150
NORMAL: 'normal',
140151
ITALIC: 'italic',

0 commit comments

Comments
 (0)