Skip to content

Commit 52e499e

Browse files
committed
Fix filter(): POSTERIZE was unreachable due to wrong condition
1 parent 79766e6 commit 52e499e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Processing.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2791,7 +2791,7 @@ void PApplet::filter(int mode, float param) {
27912791
int w = winWidth, h = winHeight, total = w * h;
27922792
::std::vector<unsigned char> buf(total * 4);
27932793
glReadPixels(0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, buf.data());
2794-
if (mode == GRAY || mode == INVERT || mode == THRESHOLD || mode == OPAQUE) {
2794+
if (mode == GRAY || mode == INVERT || mode == THRESHOLD || mode == OPAQUE || mode == POSTERIZE) {
27952795
for (int i = 0; i < total; i++) {
27962796
int r=buf[i*4],g=buf[i*4+1],b=buf[i*4+2];
27972797
int grey=(r+g+b)/3;

0 commit comments

Comments
 (0)