summaryrefslogtreecommitdiff
path: root/progs/glsl
diff options
context:
space:
mode:
authorBen Skeggs <skeggsb@gmail.com>2008-07-23 14:05:22 +1000
committerBen Skeggs <skeggsb@gmail.com>2008-07-23 14:05:22 +1000
commit704dca40c4e0e983c07d84c3a32f8f9dc78a5543 (patch)
treebdcc585315d88274ec795b7206a143d562f54a76 /progs/glsl
parent0c25ac52425e6d6eb037b99ab90f41b47e3f4491 (diff)
parent7f3d6e74817e8880a0712c85f2b41fd88cf6a347 (diff)
Merge remote branch 'upstream/gallium-0.1' into nouveau-gallium-0.1
Diffstat (limited to 'progs/glsl')
-rw-r--r--progs/glsl/convolutions.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/progs/glsl/convolutions.c b/progs/glsl/convolutions.c
index be887714c4..9b9ee53245 100644
--- a/progs/glsl/convolutions.c
+++ b/progs/glsl/convolutions.c
@@ -12,6 +12,7 @@ enum Filter {
SHARPEN,
MEAN_REMOVAL,
EMBOSS,
+ EDGE_DETECT,
NO_FILTER,
LAST
};
@@ -146,6 +147,17 @@ static void fillConvolution(GLint *k,
color[2] = 0.5;
color[3] = 0.5;
break;
+ case EDGE_DETECT:
+ k[0] = 1; k[1] = 1; k[2] = 1;
+ k[3] = 0; k[4] = 0; k[5] = 0;
+ k[6] = -1; k[7] = -1; k[8] = -1;
+
+ *scale = 1.;
+ color[0] = 0.5;
+ color[1] = 0.5;
+ color[2] = 0.5;
+ color[3] = 0.5;
+ break;
case NO_FILTER:
k[0] = 0; k[1] = 0; k[2] = 0;
k[3] = 0; k[4] = 1; k[5] = 0;
@@ -294,6 +306,7 @@ static void menuInit()
glutAddMenuEntry("Sharpen", SHARPEN);
glutAddMenuEntry("Mean removal", MEAN_REMOVAL);
glutAddMenuEntry("Emboss", EMBOSS);
+ glutAddMenuEntry("Edge detect", EDGE_DETECT);
glutAddMenuEntry("None", NO_FILTER);
glutAddMenuEntry("Quit", QUIT);