diff options
author | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2012-05-25 08:52:24 +0200 |
---|---|---|
committer | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2012-05-25 08:52:24 +0200 |
commit | 5272d9116e9b844c94c4fbba6f97b0ffbbf4c6ec (patch) | |
tree | 15ebae23e3b6a91e090b84978d957fbb12f4e34d | |
parent | 489a21b927c312fc09ad6eea4c98e596f29cec2b (diff) | |
download | cv-5272d9116e9b844c94c4fbba6f97b0ffbbf4c6ec.tar.gz cv-5272d9116e9b844c94c4fbba6f97b0ffbbf4c6ec.tar.bz2 cv-5272d9116e9b844c94c4fbba6f97b0ffbbf4c6ec.zip |
cvg: Add a pass-through filter
And rename None to Hide.
-rw-r--r-- | cvg.c | 25 | ||||
-rw-r--r-- | cvg.ui | 3 |
2 files changed, 21 insertions, 7 deletions
@@ -238,18 +238,29 @@ file_set(GtkFileChooserButton *widget, gpointer userdata) } static IplImage * -gauss_filter(struct cvg *cvg, IplImage *image) +pass_through_filter(struct cvg *cvg, IplImage *image) { IplImage *output; output = cvCreateImage(cvGetSize(image), IPL_DEPTH_8U, 3); + cvCopy(image, output, NULL); + + return output; +} + +static IplImage * +gauss_filter(struct cvg *cvg, IplImage *image) +{ + IplImage *output; + + output = cvCreateImage(cvGetSize(image), IPL_DEPTH_8U, 3); cvSmooth(image, output, CV_GAUSSIAN, 9, 9, 0, 0); return output; } static IplImage * -none_filter(struct cvg *cvg, IplImage *image) +hide_filter(struct cvg *cvg, IplImage *image) { return NULL; } @@ -280,8 +291,10 @@ method_set(GtkComboBox *widget, gpointer userdata) return; if (strcmp(text, "Gauss") == 0) cvg->filter = gauss_filter; - else if (strcmp(text, "None") == 0) - cvg->filter = none_filter; + else if (strcmp(text, "Pass-Through") == 0) + cvg->filter = pass_through_filter; + else if (strcmp(text, "Hide") == 0) + cvg->filter = hide_filter; update_right_drawing_area(cvg); } @@ -291,7 +304,7 @@ main(int argc, char *argv[]) struct cvg cvg; GtkBuilder *builder; GObject *file_chooser; - GObject *comboxbox; + GObject *combobox; gchar *path, *file; int index = 0; @@ -340,7 +353,7 @@ main(int argc, char *argv[]) gtk_combo_box_set_active(GTK_COMBO_BOX(combobox), 0); cvg.idle_source = g_idle_add(capture, &cvg); - cvg.filter = none_filter; + cvg.filter = hide_filter; gtk_widget_show_all(GTK_WIDGET(gtk_builder_get_object(builder, "win"))); g_object_unref(builder); gtk_main(); @@ -81,8 +81,9 @@ <property name="can_focus">False</property> <property name="entry_text_column">0</property> <items> - <item>None</item> + <item>Hide</item> <item>Gauss</item> + <item>Pass-Through</item> </items> <signal name="changed" handler="method_set" swapped="no"/> </object> |